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';