From: Julian Seward Date: Tue, 1 Nov 2005 02:20:19 +0000 (+0000) Subject: Make ULong_width(0) return 1 instead of 1431655765. This stops X-Git-Tag: svn/VALGRIND_3_1_0~259 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5afec1f4b79090e11605009828cc128da69b4f4;p=thirdparty%2Fvalgrind.git Make ULong_width(0) return 1 instead of 1431655765. This stops cachegrind segfaulting if it can't open its output file. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4973 --- diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c index 3e6008e4de..ec493c7656 100644 --- a/cachegrind/cg_main.c +++ b/cachegrind/cg_main.c @@ -1118,6 +1118,7 @@ static UInt ULong_width(ULong n) n = n / 10; w++; } + if (w == 0) w = 1; return w + (w-1)/3; // add space for commas }