SDL_string.c (SDL_PrintString): avoid MSVC signed/unsigned mismatch warning
authorOzkan Sezer <sezeroz@gmail.com>
Thu, 27 Sep 2018 01:10:50 +0300
changeset 1223421c060522258
parent 12233 2d31c1a48111
child 12239 55489adbb75c
SDL_string.c (SDL_PrintString): avoid MSVC signed/unsigned mismatch warning
src/stdlib/SDL_string.c
     1.1 --- a/src/stdlib/SDL_string.c	Thu Sep 27 01:00:50 2018 +0300
     1.2 +++ b/src/stdlib/SDL_string.c	Thu Sep 27 01:10:50 2018 +0300
     1.3 @@ -1397,8 +1397,8 @@
     1.4      length += SDL_min(slen, maxlen);
     1.5  
     1.6      if (info) {
     1.7 -        if (info->precision >= 0 && info->precision < sz) {
     1.8 -            slen = info->precision;
     1.9 +        if (info->precision >= 0 && (size_t)info->precision < sz) {
    1.10 +            slen = (size_t)info->precision;
    1.11              if (slen < maxlen) {
    1.12                  text[slen] = 0;
    1.13                  length -= (sz - slen);