From 615b67952f604f6832a16295c102f8f45b28046e Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 1 Sep 1988 10:07:02 +0000 Subject: [PATCH] make somewhat safer --- lang/cem/libcc/stdio/getgrent.c | 2 +- lang/cem/libcc/stdio/getpwent.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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'; -- 2.34.1