diff --git a/src/client/ioqueue.c b/src/client/ioqueue.c index 7d175ebc..d01ae166 100644 --- a/src/client/ioqueue.c +++ b/src/client/ioqueue.c @@ -125,9 +125,9 @@ ioq_gets(struct ioqueue *ioq, char *buf, int cc, int *eol) end = &buf[nbytes]; for (p = buf; p < end && *p; p++) { if (*p == '\n') { - *p = '\0'; + *++p = '\0'; *eol = 1; - dequeuecc(ioq, (p - buf) + 1); + dequeuecc(ioq, p - buf); return buf; } } diff --git a/src/client/servcmd.c b/src/client/servcmd.c index 7e002fbc..cd7944b6 100644 --- a/src/client/servcmd.c +++ b/src/client/servcmd.c @@ -312,20 +312,16 @@ output(int code, char *buf, FILE *auxfi, int eol) fprintf(auxfi, "%s", buf); if (code == C_FLUSH) (void)fflush(auxfi); - else if (eol) - (void)putc('\n', auxfi); } if (redir_fp) - fprintf(redir_fp, "%s%s", buf, eol ? "\n" : ""); + fprintf(redir_fp, "%s", buf); else if (pipe_fp) - fprintf(pipe_fp, eol ? "%s\n": "%s", buf); + fprintf(pipe_fp, "%s", buf); else { screen(buf); if (code == C_FLUSH) (void)fflush(stdout); - else if (eol) - (void)putc('\n', stdout); } }