Mercurial > hg > octave-nkf > gnulib-hg
changeset 17746:b5ad83c67b36
vasnprintf: Avoid signed/unsigned comparison warning.
* lib/vasnprintf.c (VASNPRINTF): To calculate padding,
compare end addr of generated string w/ maximum end addr.
author | Thien-Thi Nguyen <ttn@gnu.org> |
---|---|
date | Sun, 31 Aug 2014 10:27:36 +0200 |
parents | 972097f4ddc2 |
children | 98bba13df6cd |
files | ChangeLog lib/vasnprintf.c |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-08-31 Thien-Thi Nguyen <ttn@gnu.org> (tiny change) + + vasnprintf: Avoid signed/unsigned comparison warning. + * lib/vasnprintf.c (VASNPRINTF): To calculate padding, + compare end addr of generated string w/ maximum end addr. + 2013-08-30 Mats Erik Andersson <gnu@gisladisker.se> (tiny change) parse-datetime: Avoid pointer difference.
--- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -3356,7 +3356,7 @@ } /* 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;