From: Michael Snyder Date: Mon, 28 Feb 2011 22:00:45 +0000 (+0000) Subject: 2011-02-28 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f72fee2a6fb291aae34d0956f53231c2b17bea3;p=binutils-gdb.git 2011-02-28 Michael Snyder * utils.c (decimal2str): Initialize 'width' to nine, then don't mess with it. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 02b50a4cd81..3b7be586363 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2011-02-28 Michael Snyder + + * utils.c (decimal2str): Initialize 'width' to nine, then + don't mess with it. + 2011-02-28 Ulrich Weigand * hostio.c (require_data): Free *data, not data. diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c index 45d032cd9d3..78ae6f7fcee 100644 --- a/gdb/gdbserver/utils.c +++ b/gdb/gdbserver/utils.c @@ -263,19 +263,16 @@ decimal2str (char *sign, ULONGEST addr) unsigned long temp[3]; char *str = get_cell (); int i = 0; - int width; + int width = 9; do { temp[i] = addr % (1000 * 1000 * 1000); addr /= (1000 * 1000 * 1000); i++; - width -= 9; } while (addr != 0 && i < (sizeof (temp) / sizeof (temp[0]))); - width = 9; - switch (i) { case 1: