From e1ad52f53a82b3613f7ef99065d6292af2078526 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 7 Jun 2010 18:53:28 -0400 Subject: [PATCH] Add #define for maximum session id --HG-- branch : 1.7 --- iolog.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iolog.c b/iolog.c index 33a4f6c96..51287602f 100644 --- a/iolog.c +++ b/iolog.c @@ -75,6 +75,12 @@ struct script_buf { #define IOFD_TIMING 5 #define IOFD_MAX 6 +#ifdef __STDC__ +# define SESSID_MAX 2176782336U +#else +# define SESSID_MAX (unsigned long)2176782336 +#endif + static sigset_t ttyblock; static struct timeval last_time; static union io_fd io_fds[IOFD_MAX]; @@ -120,7 +126,7 @@ io_nextid() if (nread == -1) log_error(USE_ERRNO, "cannot read %s", pathbuf); id = strtoul(buf, &ep, 36); - if (buf == ep || id >= (unsigned long)2176782336) + if (buf == ep || id >= SESSID_MAX) log_error(0, "invalid sequence number %s", pathbuf); } id++; -- 2.40.0