]> sigrok.org Git - libsigrok.git/blobdiff - src/strutil.c
strutil: accept leading whitespace in parse rational
[libsigrok.git] / src / strutil.c
index 28f202c9801547e2716d332cf56f7f67c75396c2..07ed7b4491ed8b8a6ebd787b6a6ebe25ee7717b9 100644 (file)
@@ -616,6 +616,9 @@ SR_API int sr_parse_rational(const char *str, struct sr_rational *ret)
        int32_t exponent = 0;
        bool is_negative = false;
 
+       while (isspace(*str))
+               str++;
+
        errno = 0;
        integral = g_ascii_strtoll(str, &endptr, 10);