X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=parse.c;h=f0e644f113bf63171fbebc8e0bd2545ae5d0fcd8;hp=9015b1d72bd5a527ef36ed0db12646ce01fcc945;hb=8c432325c3df2075a77b27eab8a87704cf7b48ee;hpb=523bfadbd46b375012eb5f3898201455b057a1c4 diff --git a/parse.c b/parse.c index 9015b1d7..f0e644f1 100644 --- a/parse.c +++ b/parse.c @@ -159,8 +159,8 @@ void strip_blank_end(char *p) if (s) p = s; - s = p + strlen(p) - 1; - while (isspace(*s) || iscntrl(*s)) + s = p + strlen(p); + while ((isspace(*s) || iscntrl(*s)) && (s > p)) s--; *(s + 1) = '\0';