Module Name: src Committed By: roy Date: Thu Feb 11 09:42:03 UTC 2010
Modified Files: src/lib/libterminfo: term.c Log Message: Allow a NULL description. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libterminfo/term.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libterminfo/term.c diff -u src/lib/libterminfo/term.c:1.5 src/lib/libterminfo/term.c:1.6 --- src/lib/libterminfo/term.c:1.5 Thu Feb 11 00:27:09 2010 +++ src/lib/libterminfo/term.c Thu Feb 11 09:42:03 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: term.c,v 1.5 2010/02/11 00:27:09 roy Exp $ */ +/* $NetBSD: term.c,v 1.6 2010/02/11 09:42:03 roy Exp $ */ /* * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: term.c,v 1.5 2010/02/11 00:27:09 roy Exp $"); +__RCSID("$NetBSD: term.c,v 1.6 2010/02/11 09:42:03 roy Exp $"); #include <sys/stat.h> @@ -112,8 +112,12 @@ } len = le16dec(cap); cap += sizeof(uint16_t); - term->desc = cap; - cap += len; + if (len == 0) + term->desc = NULL; + else { + term->desc = cap; + cap += len; + } num = le16dec(cap); cap += sizeof(uint16_t);