Prevent potential buffer overflow in sscanf