What about using sscanf( ) instead of strtol?