Change sscanf to strtol function for the secure coding