I started to use the sscanf function to parse commands from serial port and found out that it does not work as it must do. Example:
int i, j = 0x1234; char c = '\0'; i = sscanf("anything", "%d%c", &j, &c);
Just a comment, scanf() is a notoriously dangerous function, even for experts. Best to fgets() the line and parse it out safely in memory. - Mark