Fix logic error in error-message printing code. This could never
possibly have worked as written.
This commit is contained in:
parent
990bfff9d4
commit
88196acfd8
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=68546
1 changed files with 24 additions and 0 deletions
24
net/nylon/files/patch-err.c
Normal file
24
net/nylon/files/patch-err.c
Normal file
|
@ -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);
|
||||
}
|
Loading…
Reference in a new issue