IMG_pnm.c
changeset 618 cbf3b5d96be6
parent 591 90a531f221f2
child 638 e3e9d7430674
equal deleted inserted replaced
617:d64228a395fc 618:cbf3b5d96be6
    89     if (!SDL_isdigit(ch)) {
    89     if (!SDL_isdigit(ch)) {
    90         return -1;
    90         return -1;
    91     }
    91     }
    92     do {
    92     do {
    93         /* Protect from possible overflow */
    93         /* Protect from possible overflow */
    94         if (number >= INT32_MAX / 10) {
    94         if (number >= (SDL_MAX_SINT32 / 10)) {
    95             return -1;
    95             return -1;
    96         }
    96         }
    97         number *= 10;
    97         number *= 10;
    98         number += ch-'0';
    98         number += ch-'0';
    99 
    99