From 806e8160f044f7ddaed5a6f8eac7699e1827b73d 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 cea6baa1..de75c9df 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 50ecbbe3..1ab90416 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';