Add ssizeof macro that returns ssize_t.
We can use this instead of casting the result of size_t to int. Also change checks for snprintf() returning <=0 to <0.
This commit is contained in:
@@ -466,7 +466,7 @@ fmt_authfail_message(char **str, va_list ap)
|
||||
break;
|
||||
case 'd':
|
||||
len = snprintf(dst, dst_end - dst, "%u", tries);
|
||||
if (len <= 0 || len >= (int)(dst_end - dst))
|
||||
if (len < 0 || len >= (int)(dst_end - dst))
|
||||
goto done;
|
||||
dst += len;
|
||||
src += 2;
|
||||
|
Reference in New Issue
Block a user