summaryrefslogtreecommitdiff
path: root/src/common/strlib.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-19 21:25:30 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-19 21:25:30 +0000
commita24d9b0b2ca88899e942049aa174a04024b5387f (patch)
tree12aed87756d14759775d01955ac57e1d37a4ca5d /src/common/strlib.c
parentf77c9c84c46c0b592c0a6fe6e9880eb48c48d4c3 (diff)
downloadhercules-a24d9b0b2ca88899e942049aa174a04024b5387f.tar.gz
hercules-a24d9b0b2ca88899e942049aa174a04024b5387f.tar.bz2
hercules-a24d9b0b2ca88899e942049aa174a04024b5387f.tar.xz
hercules-a24d9b0b2ca88899e942049aa174a04024b5387f.zip
* Various VC6-related fixes and tweaks. [Ai4rei]
- Fixed a typo in VC6 project files, that prevented login-server from compiling (bugreport:4061, since r12727). - Fixed usage of 'long long' in Sql_P_BindSqlDataType preventing SQL VC6 projects from compiling (bugreport:1741, since r10779). - Fixed usage of 'long long' in strtoull preventing VC6 projects from compiling (bugreport:4059, follow up to r14245). - Made strtoull default to base 10 and actually process base 8, to match the normal behavior of this function (bugreport:4059, follow up to r14245). - Fixed functions in db.c not being returned as pointer, causing warnings on VC6. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14466 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/strlib.c')
-rw-r--r--src/common/strlib.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/strlib.c b/src/common/strlib.c
index c388f949a..7a6c134e7 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -253,9 +253,9 @@ size_t strnlen (const char* string, size_t maxlen)
#endif
#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER <= 1200
-unsigned long long strtoull(const char* str, char** endptr, int base)
+uint64 strtoull(const char* str, char** endptr, int base)
{
- unsigned long long result;
+ uint64 result;
int count;
int n;
@@ -266,8 +266,13 @@ unsigned long long strtoull(const char* str, char** endptr, int base)
else
if( str[0] == '0' )
base = 8;
+ else
+ base = 10;
}
+ if( base == 8 )
+ count = sscanf(str, "%I64o%n", &result, &n);
+ else
if( base == 10 )
count = sscanf(str, "%I64u%n", &result, &n);
else