Browse code

core: sint2str check for space before adding the sign

Andrei Pelinescu-Onciul authored on 19/02/2009 18:17:13
Showing 1 changed files
... ...
@@ -312,7 +312,7 @@ static inline char* sint2str(long l, int* len)
312 312
 		l = -l;
313 313
 	}
314 314
 	p = int2str((unsigned long)l, len);
315
-	if(sign) {
315
+	if(sign && *len<(INT2STR_MAX_LEN-1)) {
316 316
 		*(--p) = '-';
317 317
 		if (len) (*len)++;
318 318
 	}