A question (comment) from the compiler (gcc 8.2):
../lib/vasnprintf.c:5107:35: warning: comparison of integer expressions of
different signedness: 'int' and 'size_t' {aka 'long unsigned int'}
[-Wsign-compare]
if (count < maxlen
^
The value of "count" is tested to be non-negative, so a cast to
"size_t" is valid.
Signed-off-by: Bjarni Ingi Gislason <[email protected]>
---
lib/vasnprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 56ffbe308..bf9d6dea9 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -5125,7 +5125,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Verify that snprintf() has NUL-terminated its
result. */
- if (count < maxlen
+ if ((size_t) count < maxlen
&& ((TCHAR_T *) (result + length)) [count] != '\0')
abort ();
/* Portability hack. */
--
2.19.0
--
Bjarni I. Gislason