Module Name: src Committed By: christos Date: Wed Jun 20 18:50:11 UTC 2012
Modified Files: src/usr.bin/xlint/common: tyname.c Log Message: better to print (null) than core-dump To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.bin/xlint/common/tyname.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/common/tyname.c diff -u src/usr.bin/xlint/common/tyname.c:1.10 src/usr.bin/xlint/common/tyname.c:1.11 --- src/usr.bin/xlint/common/tyname.c:1.10 Fri Sep 26 19:51:04 2008 +++ src/usr.bin/xlint/common/tyname.c Wed Jun 20 14:50:11 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: tyname.c,v 1.10 2008/09/26 23:51:04 matt Exp $ */ +/* $NetBSD: tyname.c,v 1.11 2012/06/20 18:50:11 christos Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tyname.c,v 1.10 2008/09/26 23:51:04 matt Exp $"); +__RCSID("$NetBSD: tyname.c,v 1.11 2012/06/20 18:50:11 christos Exp $"); #endif #include <limits.h> @@ -96,6 +96,8 @@ tyname(char *buf, size_t bufsiz, type_t char lbuf[64]; char cv[20]; + if (tp == NULL) + return "(null)"; if ((t = tp->t_tspec) == INT && tp->t_isenum) t = ENUM;