I'd make this take an integer and do the atoi (rather, a strtol()) in the calling function.