On Sat, 18 Nov 2017 02:13:38 +0530 Nishanth Devarajan <ndev2...@gmail.com> wrote:
> + result = strtoul(buf, &endp, 0); > + > + if (*endp || buf == endp) { > + fprintf(stderr, "value \"%s\" in file %s is not a number\n", > + buf, fname); > + goto out; > + } > + > + if (result == ULONG_MAX && errno == ERANGE) { > + fprintf(stderr, "strtoul %s: %s", fname, strerror(errno)); > + goto out; > + } Since speed value of unknown is represented as "-1" I think you need to change this API to take signed value (ie use strtol)