Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libterminfo PR/45370: Takehiko NOZAKI: termcap emulation...
details: https://anonhg.NetBSD.org/src/rev/ef01a62fd4c3
branches: trunk
changeset: 769643:ef01a62fd4c3
user: christos <christos%NetBSD.org@localhost>
date: Fri Sep 16 18:51:44 2011 +0000
description:
PR/45370: Takehiko NOZAKI: termcap emulation tget{flag,num,str} should
work with non-NUL terminated strings.
diffstat:
lib/libterminfo/termcap.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
diffs (68 lines):
diff -r 770af23d55d4 -r ef01a62fd4c3 lib/libterminfo/termcap.c
--- a/lib/libterminfo/termcap.c Fri Sep 16 18:43:44 2011 +0000
+++ b/lib/libterminfo/termcap.c Fri Sep 16 18:51:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: termcap.c,v 1.14 2011/03/18 10:42:54 roy Exp $ */
+/* $NetBSD: termcap.c,v 1.15 2011/09/16 18:51:44 christos Exp $ */
/*
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: termcap.c,v 1.14 2011/03/18 10:42:54 roy Exp $");
+__RCSID("$NetBSD: termcap.c,v 1.15 2011/09/16 18:51:44 christos Exp $");
#include <assert.h>
#include <ctype.h>
@@ -74,13 +74,12 @@
}
int
-tgetflag(const char *id)
+tgetflag(const char *id2)
{
uint32_t ind;
size_t i;
TERMUSERDEF *ud;
-
- _DIAGASSERT(id != NULL);
+ const char id[] = { id2[0], id2[1], '\0' };
if (cur_term == NULL)
return 0;
@@ -99,14 +98,13 @@
}
int
-tgetnum(const char *id)
+tgetnum(const char *id2)
{
uint32_t ind;
size_t i;
TERMUSERDEF *ud;
const TENTRY *te;
-
- _DIAGASSERT(id != NULL);
+ const char id[] = { id2[0], id2[1], '\0' };
if (cur_term == NULL)
return -1;
@@ -132,14 +130,13 @@
}
char *
-tgetstr(const char *id, char **area)
+tgetstr(const char *id2, char **area)
{
uint32_t ind;
size_t i;
TERMUSERDEF *ud;
const char *str;
-
- _DIAGASSERT(id != NULL);
+ const char id[] = { id2[0], id2[1], '\0' };
if (cur_term == NULL)
return NULL;
Home |
Main Index |
Thread Index |
Old Index