That is bad practice! `atoi` has no error verification so we cannot distinguish empty line from some input error. I'd suggest to do the following:

1. Use `strtoul` function and examine its `err` param
2. If `err` is NULL or is equal to `\0` then treat it as number
3. If `err` is `\n` or `\r` then treat it as default value
4. If `err` is something else treat it as an input error and return `-1`.