[Bug 1589] sscanf assigns incorrect value to %n variable