what happens when base is 0 for strtol
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
int main(int argc, char **argv) {
char *next = NULL;
errno = 0;
long longi = strtol(argv[1], &next, 0);
int i = longi;
printf("longi: %ld\n",longi);
printf("i: %d\n",i);
printf("next is |%s|\n",next);
if(errno != 0) {
perror("strtol");
}
return 0;
}