diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-12-08 21:44:33 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-12-08 21:44:33 +0000 |
commit | f00a5870d54a2c06537cbde9dd1a44566c411f51 (patch) | |
tree | d02ef80abcadcad4e23a9fa731355c998b7eebbd /snprintf.c | |
parent | eed308b5fa07581dbb52d3d1bbdb7915b3c0738b (diff) |
Put the "0[xX]" prefix for "%#[Xx]", and the "0" prefix for "%#o",
*before* any padding "0"s.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1245 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'snprintf.c')
-rw-r--r-- | snprintf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/snprintf.c b/snprintf.c index 1c27df7cef..7bf36f4deb 100644 --- a/snprintf.c +++ b/snprintf.c @@ -276,9 +276,9 @@ double d; tmp = otoa(d); p->width -= strlen(tmp); - PAD_RIGHT(p); if (p->square == FOUND) /* had prefix '0' for octal */ PUT_CHAR('0', p); + PAD_RIGHT(p); while (*tmp) { /* octal */ PUT_CHAR(*tmp, p); tmp++; @@ -300,10 +300,10 @@ double d; tmp = htoa(d); p->width -= strlen(tmp); - PAD_RIGHT(p); if (p->square == FOUND) { /* prefix '0x' for hexa */ PUT_CHAR('0', p); PUT_CHAR(*p->pf, p); } + PAD_RIGHT(p); while (*tmp) { /* hexa */ PUT_CHAR((*p->pf == 'X' ? toupper(*tmp) : *tmp), p); tmp++; |