Generate shorter code for sscanf.

Signed-off-by: Felix A. Croes <felix@dworkin.nl>
Fix the bug that coverity found.

Signed-off-by: Felix A. Croes <felix@dworkin.nl>