NormEZ did not warn about the length of this function, very sad
int my_getnbr(char *str)
{
int negative_multiplier;
unsigned long long int storage;
negative_multiplier = 1;
storage = 0;
while (*str && *str != '\0' && (*str == '+' || *str == '-')){
if (*str == '-') negative_multiplier *= -1;
str++;
}
while (*str && *str != '\0' && (*str >= '0' && *str <= '9')){
if (storage > 214748364){
return 0;
}
storage = storage*10 + *str-48;
str++;
}
if (negative_multiplier == -1 && storage > 2147483648){
return 0;
} else if (negative_multiplier == 1 && storage > 2147483647){
return 0;
}
storage *= negative_multiplier;
return (storage);
}
NormEZ did not warn about the length of this function, very sad