From 07d70d9eab4d07dea291a2de4670c67664eafdce Mon Sep 17 00:00:00 2001 From: smokexyz Date: Fri, 2 Jun 2017 22:10:00 +0800 Subject: Fix replace statement formatting in storage save function. --- src/char/int_storage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/char/int_storage.c') diff --git a/src/char/int_storage.c b/src/char/int_storage.c index 20e852c66..65301127f 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -86,13 +86,13 @@ int inter_storage_tosql(int account_id, const struct storage_data *p) StrBuf->AppendStr(&buf, ", `expire_time`, `bound`, `unique_id`) VALUES"); } - StrBuf->Printf(&buf, "('%d', '%d', '%d', '%d', '%u', '%d', '%d', '%d'", - cp_it->id, account_id, p_it->nameid, p_it->amount, p_it->equip, p_it->identify, p_it->refine, p_it->attribute); + StrBuf->Printf(&buf, "%s('%d', '%d', '%d', '%d', '%u', '%d', '%d', '%d'", + total_updates > 0 ? ", " : "", cp_it->id, account_id, p_it->nameid, p_it->amount, p_it->equip, p_it->identify, p_it->refine, p_it->attribute); for (k = 0; k < MAX_SLOTS; k++) StrBuf->Printf(&buf, ", '%d'", p_it->card[k]); for (k = 0; k < MAX_ITEM_OPTIONS; ++k) StrBuf->Printf(&buf, ", '%d', '%d'", p_it->option[k].index, p_it->option[k].value); - StrBuf->Printf(&buf, ", '%u', '%d', '%"PRIu64"')%s", p_it->expire_time, p_it->bound, p_it->unique_id, total_updates > 0 ? ", " : ""); + StrBuf->Printf(&buf, ", '%u', '%d', '%"PRIu64"')", p_it->expire_time, p_it->bound, p_it->unique_id); total_updates++; } -- cgit v1.2.3-60-g2f50