Fix SLC_NAME_OK() macro which would return non-zero, if given the
authorrobin <robin@openbsd.org>
Wed, 11 Dec 1996 17:05:25 +0000 (17:05 +0000)
committerrobin <robin@openbsd.org>
Wed, 11 Dec 1996 17:05:25 +0000 (17:05 +0000)
argument: 0 (which is not a valid SLC code -- valid SLC codes are currently
1 -> 30 inclusive, from RFC-1184).

include/arpa/telnet.h

index 5ab526a..f396e10 100644 (file)
@@ -235,7 +235,7 @@ extern char *slc_names[];
 #define        SLC_NAMES SLC_NAMELIST
 #endif
 
-#define        SLC_NAME_OK(x)  ((unsigned int)(x) <= NSLC)
+#define        SLC_NAME_OK(x)  ((unsigned)(x) > 0 && (unsigned)(x) <= NSLC)
 #define SLC_NAME(x)    slc_names[x]
 
 #define        SLC_NOSUPPORT   0