From 0c02e7a2e0ade03cfd5c6111dea0633623e70bc4 Mon Sep 17 00:00:00 2001 From: roy Date: Thu, 11 Feb 2010 09:42:03 +0000 Subject: [PATCH] Allow a NULL description. --- lib/libterminfo/term.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libterminfo/term.c b/lib/libterminfo/term.c index f1461bfdcdb8..d5b92da10bf0 100644 --- a/lib/libterminfo/term.c +++ b/lib/libterminfo/term.c @@ -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 -__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 @@ -112,8 +112,12 @@ _ti_readterm(TERMINAL *term, const char *cap, size_t caplen, int flags) } 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);