diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-11-22 16:00:03 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-11-22 16:00:03 +0000 |
commit | b561fcc8037f50a9f562f2bcaa2b6d8e4644bcc4 (patch) | |
tree | 8a858d44af8f2d38ab2e332026b2ee09b420059f | |
parent | f5d656918f0a76907b03d546d2d9e68edb48664c (diff) | |
download | hercules-b561fcc8037f50a9f562f2bcaa2b6d8e4644bcc4.tar.gz hercules-b561fcc8037f50a9f562f2bcaa2b6d8e4644bcc4.tar.bz2 hercules-b561fcc8037f50a9f562f2bcaa2b6d8e4644bcc4.tar.xz hercules-b561fcc8037f50a9f562f2bcaa2b6d8e4644bcc4.zip |
* Fixed saving/loading errors with compilers (such as VC6, MinGW), which do not recognize %ll format (since r14242).
- This also fixes guild leader name being displayed and saved as "(null)" in the guild member list.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14486 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Renewal.txt | 2 | ||||
-rw-r--r-- | src/char/int_guild.c | 4 | ||||
-rw-r--r-- | src/char_sql/int_guild.c | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/Changelog-Renewal.txt b/Changelog-Renewal.txt index a218ef196..fdec5fc24 100644 --- a/Changelog-Renewal.txt +++ b/Changelog-Renewal.txt @@ -5,6 +5,8 @@ Date Added * Fixed a crash when shutting down char-server (TXT only), after it failed to load storage save data (since r1275). [Ai4rei] * Batch files (Windows) now detect whether the server crashed, aborted or shutdown cleanly (Ctrl+C or @mapexit) and print appropriate message, instead of always assuming, that the server crashed (bugreport:3476, since r1818). [Ai4rei] * Fixed map server getting notified of hair, hair color, gender, class and level changes from a char server (TXT only) twice (since r2986). [Ai4rei] + * Fixed saving/loading errors with compilers (such as VC6, MinGW), which do not recognize %ll format (since r14242). [Ai4rei] + - This also fixes guild leader name being displayed and saved as "(null)" in the guild member list. 2010/11/21 * Added msinttypes (rev. 26, http://msinttypes.googlecode.com/svn/trunk/) portability framework for Visual C++ compilers (related bugreport:4059). [Ai4rei] * Added 64-bit variants of the socket and buffer I/O macros. [Ai4rei] diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 01d88e4f2..ed9e52d96 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -49,7 +49,7 @@ int inter_guild_tostr(char* str, struct guild* g) for(i = 0; i < g->max_member; i++) { struct guild_member *m = &g->member[i]; - len += sprintf(str + len, "%d,%d,%d,%d,%d,%d,%d,%llu,%d,%d\t%s\t", + len += sprintf(str + len, "%d,%d,%d,%d,%d,%d,%d,%"PRIu64",%d,%d\t%s\t", m->account_id, m->char_id, m->hair, m->hair_color, m->gender, m->class_, m->lv, m->exp, m->exp_payper, m->position, @@ -160,7 +160,7 @@ int inter_guild_fromstr(char* str, struct guild* g) for( i = 0; i < g->max_member; i++ ) { struct guild_member* m = &g->member[i]; - if (sscanf(str, "%d,%d,%d,%d,%d,%d,%d,%llu,%d,%d\t%[^\t]\t%n", + if (sscanf(str, "%d,%d,%d,%d,%d,%d,%d,%"SCNu64",%d,%d\t%[^\t]\t%n", &accountid, &charid, &hair, &hair_color, &gender, &class_, &lv, &exp, &exp_payper, &position, name, &len) < 11) diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c index 8c165e92c..3d2df8977 100644 --- a/src/char_sql/int_guild.c +++ b/src/char_sql/int_guild.c @@ -265,7 +265,7 @@ int inter_guild_tosql(struct guild *g,int flag) //Since nothing references guild member table as foreign keys, it's safe to use REPLACE INTO Sql_EscapeStringLen(sql_handle, esc_name, m->name, strnlen(m->name, NAME_LENGTH)); if( SQL_ERROR == Sql_Query(sql_handle, "REPLACE INTO `%s` (`guild_id`,`account_id`,`char_id`,`hair`,`hair_color`,`gender`,`class`,`lv`,`exp`,`exp_payper`,`online`,`position`,`name`) " - "VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%llu','%d','%d','%d','%s')", + "VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%"PRIu64"','%d','%d','%d','%s')", guild_member_db, g->guild_id, m->account_id, m->char_id, m->hair, m->hair_color, m->gender, m->class_, m->lv, m->exp, m->exp_payper, m->online, m->position, esc_name) ) @@ -455,7 +455,7 @@ struct guild * inter_guild_fromsql(int guild_id) Sql_GetData(sql_handle, 4, &data, NULL); m->gender = atoi(data); Sql_GetData(sql_handle, 5, &data, NULL); m->class_ = atoi(data); Sql_GetData(sql_handle, 6, &data, NULL); m->lv = atoi(data); - Sql_GetData(sql_handle, 7, &data, NULL); m->exp = (uint64)strtoull(data, NULL, 10); + Sql_GetData(sql_handle, 7, &data, NULL); m->exp = strtoull(data, NULL, 10); Sql_GetData(sql_handle, 8, &data, NULL); m->exp_payper = (unsigned int)atoi(data); Sql_GetData(sql_handle, 9, &data, NULL); m->online = atoi(data); Sql_GetData(sql_handle, 10, &data, NULL); m->position = atoi(data); |