diff options
author | Thien-Thi Nguyen <ttn@gnu.org> | 2014-08-31 10:27:36 +0200 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2014-08-31 11:30:52 +0100 |
commit | c8842e6a275c7db033b14197d7dcb7de2b8d23b5 (patch) | |
tree | 05f9b1de1acd79866e71e03b58760b7506ba6cf1 /lib/vasnprintf.c | |
parent | 2252ab6581f8fe611e196e04e7016e2c6e8bcd2f (diff) | |
download | gnulib-c8842e6a275c7db033b14197d7dcb7de2b8d23b5.tar.gz |
vasnprintf: Avoid signed/unsigned comparison warning.
* lib/vasnprintf.c (VASNPRINTF): To calculate padding,
compare end addr of generated string w/ maximum end addr.
Diffstat (limited to 'lib/vasnprintf.c')
-rw-r--r-- | lib/vasnprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index f2ccc1c9cc..6ca47ebd0a 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -3356,7 +3356,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } /* The generated string now extends from tmp to p, with the zero padding insertion point being at pad_ptr. */ - if (has_width && p - tmp < width) + if (has_width && p < tmp + width) { size_t pad = width - (p - tmp); DCHAR_T *end = p + pad; |