itsanjan / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Stream parseInt() and parseFloat() functions swallow the initial trailing (non-numeric) character. #624

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From Bill Greiman: "If you call parseInt() with the string "567pq", 'p' is 
consumed and the next read returns 'q'."

We should use peek() to get around this.  

Original issue reported on code.google.com by dmel...@gmail.com on 5 Sep 2011 at 11:16

GoogleCodeExporter commented 9 years ago
This patch uses peek() to avoid consuming the trailing character.

Original comment by paul.sto...@gmail.com on 8 Sep 2011 at 10:11

Attachments:

GoogleCodeExporter commented 9 years ago
https://github.com/arduino/Arduino/commit/f3d8628c5edf584d9d4495cf18625475206d92
c2

Original comment by dmel...@gmail.com on 9 Sep 2011 at 8:26

GoogleCodeExporter commented 9 years ago

Original comment by dmel...@gmail.com on 9 Sep 2011 at 8:27