From 88196acfd8953d3a8cd15c02070402f7c3d31b22 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Mon, 21 Oct 2002 21:57:59 +0000 Subject: Fix logic error in error-message printing code. This could never possibly have worked as written. --- net/nylon/files/patch-err.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 net/nylon/files/patch-err.c (limited to 'net/nylon') diff --git a/net/nylon/files/patch-err.c b/net/nylon/files/patch-err.c new file mode 100644 index 000000000000..42d51bef3ccf --- /dev/null +++ b/net/nylon/files/patch-err.c @@ -0,0 +1,24 @@ +--- ../../work.orig/nylon-0.3/err.c Mon Oct 21 17:54:24 2002 ++++ err.c Mon Oct 21 17:56:03 2002 +@@ -16,7 +16,7 @@ + + extern int verbose; + +-char nylon_err[] = { "Error in receiving", /* ERROR_RECV */ ++char *nylon_err[] = { "Error in receiving", /* ERROR_RECV */ + "Error in sending", /* ERROR_SEND */ + "Error in header", /* ERROR_HEAD */ + "Error in address", /* ERROR_ADDR */ +@@ -55,10 +55,10 @@ + #else + va_start(ap); + #endif /* __STDC__ */ +- if (fmt && (level <= verbose) && errn < NERRS && errn >= 0) { ++ if (fmt && (level <= verbose) && errn < NERRS && errn > 0) { + fprintf(stderr, "nylon: [error] "); + vfprintf(stderr, fmt, ap); +- fprintf(stderr, "%s", nylon_err + errn); ++ fprintf(stderr, "%s", nylon_err[errn - 1]); + } + va_end(ap); + } -- cgit v1.2.3