X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=interfaces%2Fmysql%2Fclsql-mysql.c;h=ac83039bf155c34b581aa8ca18aac686bfdbc630;hp=4fd36dbaa989de099a0a38258c6bb5aef8ee3786;hb=c60de8741d11ae54f2bfcadf87c8703ad7da0970;hpb=8e83690d8dc88baafeb75f5b48a80a6c0e6a89c3 diff --git a/interfaces/mysql/clsql-mysql.c b/interfaces/mysql/clsql-mysql.c index 4fd36db..ac83039 100644 --- a/interfaces/mysql/clsql-mysql.c +++ b/interfaces/mysql/clsql-mysql.c @@ -6,7 +6,7 @@ * Programmer: Kevin M. Rosenberg * Date Started: Mar 2002 * - * $Id: clsql-mysql.c,v 1.2 2002/03/27 05:37:35 kevin Exp $ + * $Id: clsql-mysql.c,v 1.3 2002/03/27 05:48:22 kevin Exp $ * * This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg * @@ -84,6 +84,13 @@ atol64 (const unsigned char* str, int* pHigh32) { long long result = 0; int minus = 0; + int first_char = *str; + if (first_char == '+') + ++str; + else if (first_char == '-') { + minus = 1; + ++str; + } while (*str) { int i = *str - '0'; @@ -92,6 +99,8 @@ atol64 (const unsigned char* str, int* pHigh32) result = i + (10 * result); str++; } + if (minus) + result = -result; *pHigh32 = upper_32bits(result); return lower_32bits(result);