From 9c0891d48e02da725c4be111b279d85f081ed9a3 Mon Sep 17 00:00:00 2001 From: robin <> Date: Wed, 11 Dec 1996 17:05:25 +0000 Subject: [PATCH] Fix SLC_NAME_OK() macro which would return non-zero, if given the argument: 0 (which is not a valid SLC code -- valid SLC codes are currently 1 -> 30 inclusive, from RFC-1184). --- src/include/arpa/telnet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/arpa/telnet.h b/src/include/arpa/telnet.h index 5ab526a4..f396e105 100644 --- a/src/include/arpa/telnet.h +++ b/src/include/arpa/telnet.h @@ -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