summaryrefslogtreecommitdiff
path: root/lib/ZParseNot.c
diff options
context:
space:
mode:
authorGravatar Kenneth G Raeburn <raeburn@mit.edu>1991-03-28 22:34:46 +0000
committerGravatar Kenneth G Raeburn <raeburn@mit.edu>1991-03-28 22:34:46 +0000
commit44f7c0f58b42276614a1bd9359cf4a4850958639 (patch)
tree605173f74bc591ca6ea30256cda0c67696746301 /lib/ZParseNot.c
parent18f52f200757e6702c8fdffdc0a9362adbc44c4d (diff)
Redefine macro BAD to reduce lint warnings.
Diffstat (limited to 'lib/ZParseNot.c')
-rw-r--r--lib/ZParseNot.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/ZParseNot.c b/lib/ZParseNot.c
index 1aa4d3c..44ae68c 100644
--- a/lib/ZParseNot.c
+++ b/lib/ZParseNot.c
@@ -84,9 +84,17 @@ Code_t ZParseNotice(buffer, len, notice)
u_short us;
ZChecksum_t sum;
} temp;
+
#ifdef __LINE__
int lineno;
-#define BAD do{lineno=__LINE__;goto badpkt;}while(0)
+ /* Note: This definition of BAD eliminates lint and compiler
+ * complains about the "while (0)", but require that the macro not
+ * be used as the "then" part of an "if" statement that also has
+ * an "else" clause.
+ */
+#define BAD {lineno=__LINE__;goto badpkt;}
+ /* This one gets lint/compiler complaints. */
+/*#define BAD do{lineno=__LINE__;goto badpkt;}while(0)*/
#else
#define BAD goto badpkt
#endif
@@ -121,7 +129,7 @@ Code_t ZParseNotice(buffer, len, notice)
numfields -= 2; /* numfields, version, and checksum */
if (numfields < 0) {
#ifdef __LINE__
- lineno = __LINE__ - 2;
+ lineno = __LINE__;
badpkt:
Z_debug ("ZParseNotice: bad packet from %s/%d (line %d)",
inet_ntoa (notice->z_uid.zuid_addr.s_addr),