X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=lib%2Fstrntol.c;h=c3a55a117801f56fbe39a40e9b09327968cbc3e0;hb=38b253f3b6c6c975aa8a5660ab19fa44a7804297;hp=713f63bb0c683201f61b545f6ba7386f3dc19055;hpb=bd99994bdb37f34b7afb68a47d1ddffb1891ff8b;p=fio.git diff --git a/lib/strntol.c b/lib/strntol.c index 713f63bb..c3a55a11 100644 --- a/lib/strntol.c +++ b/lib/strntol.c @@ -2,6 +2,8 @@ #include #include +#include "strntol.h" + long strntol(const char *str, size_t sz, char **end, int base) { /* Expect that digit representation of LONG_MAX/MIN @@ -26,6 +28,6 @@ long strntol(const char *str, size_t sz, char **end, int base) if (ret == LONG_MIN || ret == LONG_MAX) return ret; if (end) - *end = (char *)str + (*end - buf); + *end = (char *)beg + (*end - buf); return ret; }