From: Guido van Rossum Date: Sun, 12 Jan 1997 19:48:03 +0000 (+0000) Subject: Changed hex() and oct() again, to never emit a '-' sign. X-Git-Tag: v1.5a1~539 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ebee0256f35d9d450f718de0eaf49f0bfc6ae1bc;p=thirdparty%2FPython%2Fcpython.git Changed hex() and oct() again, to never emit a '-' sign. --- diff --git a/Objects/intobject.c b/Objects/intobject.c index c4ade847fdce..76d914584dac 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -725,10 +725,8 @@ int_oct(v) long x = v -> ob_ival; if (x == 0) strcpy(buf, "0"); - else if (-x < 0) - sprintf(buf, "0%lo", x); else - sprintf(buf, "-0%lo", -x); + sprintf(buf, "0%lo", x); return newstringobject(buf); } @@ -738,10 +736,7 @@ int_hex(v) { char buf[20]; long x = v -> ob_ival; - if (-x <= 0) - sprintf(buf, "0x%lx", x); - else - sprintf(buf, "-0x%lx", -x); + sprintf(buf, "0x%lx", x); return newstringobject(buf); }