]> sigrok.org Git - libsigrok.git/commit - src/strutil.c
strutil: handle empty fractional in parse rational
authorGerhard Sittig <redacted>
Thu, 19 Jul 2018 19:05:54 +0000 (21:05 +0200)
committerUwe Hermann <redacted>
Sun, 22 Jul 2018 14:36:15 +0000 (16:36 +0200)
commit42408643f9dcb80d1744aaa4d08e0170594daad1
tree9f1dae65f0a934e15c85433c6ebd63b75d9f9c6a
parentdd3202febf9871a0867f317a0af33dd990cf0760
strutil: handle empty fractional in parse rational

Accept numbers like "123." where the period (dot) is present yet the
fractional part is empty. Adding a period but no additional digits is a
popular method of turning an otherwise integer literal into a float.
Compilers and strtod() routines accept this notation, too, so we have to
expect seeing such input.
src/strutil.c