Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libterminfo Allow a NULL description.



details:   https://anonhg.NetBSD.org/src/rev/77152d30a154
branches:  trunk
changeset: 752017:77152d30a154
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Feb 11 09:42:03 2010 +0000

description:
Allow a NULL description.

diffstat:

 lib/libterminfo/term.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 5ad14c24a950 -r 77152d30a154 lib/libterminfo/term.c
--- a/lib/libterminfo/term.c    Thu Feb 11 09:34:12 2010 +0000
+++ b/lib/libterminfo/term.c    Thu Feb 11 09:42:03 2010 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index