fix DEBUG decimal() of negative number

This commit is contained in:
John Reiser
2012-08-23 12:37:44 -07:00
parent ad1c0f578e
commit be96c28b77
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ decimal(int x, char *ptr, int n)
{ {
if (x < 0) { if (x < 0) {
x = -x; x = -x;
*ptr = '-'; ++n; *ptr[n++] = '-';
} }
return unsimal(x, ptr, n); return unsimal(x, ptr, n);
} }
+1 -1
View File
@@ -123,7 +123,7 @@ decimal(int x, char *ptr, int n)
{ {
if (x < 0) { if (x < 0) {
x = -x; x = -x;
*ptr = '-'; ++n; *ptr[n++] = '-';
} }
return unsimal(x, ptr, n); return unsimal(x, ptr, n);
} }
+1 -1
View File
@@ -62,7 +62,7 @@ decimal(int x, char *ptr, int n)
{ {
if (x < 0) { if (x < 0) {
x = -x; x = -x;
*ptr = '-'; ++n; *ptr[n++] = '-';
} }
return unsimal(x, ptr, n); return unsimal(x, ptr, n);
} }