diff --git a/examples/loadables/cut.c b/examples/loadables/cut.c index ed4972d2..280c5231 100644 --- a/examples/loadables/cut.c +++ b/examples/loadables/cut.c @@ -417,6 +417,8 @@ cutfile (v, list, ops) while ((n = zgetline (fd, &line, &llen, '\n', unbuffered_read)) != -1) { QUIT; + if (line[n] == '\n') + line[n] = '\0'; cutline (v, line, ops); /* can modify line */ } if (fd > 0)