From: ceriel Date: Thu, 1 Sep 1988 10:07:02 +0000 (+0000) Subject: make somewhat safer X-Git-Tag: release-5-5~2878 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=615b67952f604f6832a16295c102f8f45b28046e;p=ack.git make somewhat safer --- diff --git a/lang/cem/libcc/stdio/getgrent.c b/lang/cem/libcc/stdio/getgrent.c index cea6baa16..de75c9df7 100644 --- a/lang/cem/libcc/stdio/getgrent.c +++ b/lang/cem/libcc/stdio/getgrent.c @@ -64,7 +64,7 @@ static getline () static skip_period () { - while (*_buf != ':') + while (*_buf && *_buf != ':') _buf++; *_buf++ = '\0'; } diff --git a/lang/cem/libcc/stdio/getpwent.c b/lang/cem/libcc/stdio/getpwent.c index 50ecbbe3d..1ab904167 100644 --- a/lang/cem/libcc/stdio/getpwent.c +++ b/lang/cem/libcc/stdio/getpwent.c @@ -65,7 +65,7 @@ static getline () static skip_period () { - while (*_buf != ':') + while (*_buf && *_buf != ':') _buf++; *_buf++ = '\0';