Fixed sign-compare warnings

This commit is contained in:
Armin Novak 2019-02-07 14:35:10 +01:00
parent 699d7d1462
commit 6f3808a224
1 changed files with 4 additions and 1 deletions

View File

@ -34,7 +34,10 @@ errno_t _itoa_s(int value, char* buffer, size_t sizeInCharacters, int radix)
length = sprintf_s(NULL, 0, "%d", value);
if (sizeInCharacters < length)
if (length < 0)
return -1;
if (sizeInCharacters < (size_t)length)
return -1;
sprintf_s(buffer, length + 1, "%d", value);