geomyidae

A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log | Files | Refs | README | LICENSE

commit 93c55f39d5bd322b6dc9bf13fb2025264dc52341
parent c98811c741255305b3fbff36a7b06bfb263d3ebc
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sun, 11 Jun 2017 19:24:16 +0200

Use vdprintf() instead of the dup dup.

Diffstat:
ind.c | 13+------------
1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/ind.c b/ind.c @@ -281,22 +281,11 @@ void tprintf(int fd, char *fmt, ...) { va_list fmtargs; - int fd2; - FILE *fp; - - fd2 = dup(fd); - fp = fdopen(fd2, "w"); - if(fp == nil) { - perror("fdopen"); - return; - } va_start(fmtargs, fmt); - vfprintf(fp, fmt, fmtargs); + vdprintf(fd, fmt, fmtargs); va_end(fmtargs); - fclose(fp); - return; }