Source-Changes-HG archive

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

[src/trunk]: src/lib/libterminfo Warn about unprintable characters in capabil...



details:   https://anonhg.NetBSD.org/src/rev/0dba1e98c756
branches:  trunk
changeset: 821634:0dba1e98c756
user:      roy <roy%NetBSD.org@localhost>
date:      Sat Feb 11 15:13:17 2017 +0000

description:
Warn about unprintable characters in capability strings.

diffstat:

 lib/libterminfo/compile.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 0293e0b1dd25 -r 0dba1e98c756 lib/libterminfo/compile.c
--- a/lib/libterminfo/compile.c Sat Feb 11 15:11:45 2017 +0000
+++ b/lib/libterminfo/compile.c Sat Feb 11 15:13:17 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compile.c,v 1.10 2017/02/11 14:57:15 roy Exp $ */
+/* $NetBSD: compile.c,v 1.11 2017/02/11 15:13:17 roy Exp $ */
 
 /*
  * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: compile.c,v 1.10 2017/02/11 14:57:15 roy Exp $");
+__RCSID("$NetBSD: compile.c,v 1.11 2017/02/11 15:13:17 roy Exp $");
 
 #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H
 #include <sys/endian.h>
@@ -347,7 +347,10 @@
                                        ch = '\177';
                                else if ((ch &= 037) == 0)
                                        ch = (char)128;
-                       }
+                       } else if (!isprint((unsigned char)ch))
+                               dowarn(flags,
+                                   "%s: %s: unprintable character",
+                                   term, cap);
                        *p++ = ch;
                        last = ch;
                        continue;



Home | Main Index | Thread Index | Old Index