fix segfault on some implementations of atoi