From ccb03bf540762bed7e69099aadc68ae52d07c155 Mon Sep 17 00:00:00 2001 From: davidxu Date: Tue, 24 Dec 2002 07:40:10 +0000 Subject: Check NULL pointer to avoid SIGSEGV --- usr.bin/gencat/genlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.bin') diff --git a/usr.bin/gencat/genlib.c b/usr.bin/gencat/genlib.c index 8eaf39c..d0fcefa 100644 --- a/usr.bin/gencat/genlib.c +++ b/usr.bin/gencat/genlib.c @@ -450,7 +450,8 @@ MCReadCat(int fd) static void printS(int fd, const char *str) { - write(fd, str, strlen(str)); + if (str) + write(fd, str, strlen(str)); } static void -- cgit v1.1