itoa() c implementation int min underflow
问题 I'm running some test cases against my itoa() function but keep getting did not allocate memory for the int min value I'm doing the check but it's something I'm missing here, what is it? char *ft_itoa(int x) { char *s; size_t len; long int n; n = x; if (x == -2147483648) return (ft_strdup("-2147483648")); len = ft_intlen(n) + 1; if (!(s = (char*)malloc(sizeof(char) * len))) return (NULL); if (n == 0) s[0] = '0'; if (n < 0) { s[0] = '-'; n = -n; } s[len - 1] = '\0'; while (n) { len--; s[len -