From: Ralph Corderoy Date: Mon, 17 Apr 2017 10:50:39 +0000 (+0100) Subject: Allow advertise() to assume strerror(3) won't fail. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/791576c7f643c97ca087720751ea89f357c5b8fa?ds=sidebyside Allow advertise() to assume strerror(3) won't fail. The code already assumes that elsewhere when it calls strerror(). --- diff --git a/sbr/error.c b/sbr/error.c index 8057302a..efd02917 100644 --- a/sbr/error.c +++ b/sbr/error.c @@ -85,7 +85,7 @@ void advertise (const char *what, char *tail, const char *fmt, va_list ap) { int eindex = errno; - char buffer[NMH_BUFSIZ], errbuf[NMH_BUFSIZ], *err; + char buffer[NMH_BUFSIZ], *err; struct iovec iob[10], *iov; size_t niov; @@ -113,11 +113,6 @@ advertise (const char *what, char *tail, const char *fmt, va_list ap) } ADD_LITERAL(": "); err = strerror(eindex); - if (!err) { - /* this shouldn't happen, but we'll test for it just in case */ - snprintf(errbuf, sizeof(errbuf), "Error %d", eindex); - err = errbuf; - } ADD_VAR(err); } if (tail && *tail) {