Source-Changes-HG archive

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

[src/trunk]: src/lib/libterminfo support for older compilers



details:   https://anonhg.NetBSD.org/src/rev/105b11e5b2bb
branches:  trunk
changeset: 1008596:105b11e5b2bb
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Mar 28 02:38:15 2020 +0000

description:
support for older compilers

diffstat:

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

diffs (29 lines):

diff -r c5eceb467720 -r 105b11e5b2bb lib/libterminfo/compile.c
--- a/lib/libterminfo/compile.c Sat Mar 28 01:08:42 2020 +0000
+++ b/lib/libterminfo/compile.c Sat Mar 28 02:38:15 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compile.c,v 1.16 2020/03/27 17:39:53 christos Exp $ */
+/* $NetBSD: compile.c,v 1.17 2020/03/28 02:38:15 christos Exp $ */
 
 /*
  * Copyright (c) 2009, 2010, 2011, 2020 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: compile.c,v 1.16 2020/03/27 17:39:53 christos Exp $");
+__RCSID("$NetBSD: compile.c,v 1.17 2020/03/28 02:38:15 christos Exp $");
 
 #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H
 #include <sys/endian.h>
@@ -416,7 +416,9 @@
 static int
 _ti_find_rtype(const char *cap)
 {
-       for (const char *ptr = cap; (ptr = strchr(ptr, '#')) != NULL;) {
+       const char *ptr;
+
+       for (ptr = cap; (ptr = strchr(ptr, '#')) != NULL;) {
                if (strtol(++ptr, NULL, 0) > SHRT_MAX) {
                        return TERMINFO_RTYPE;
                }



Home | Main Index | Thread Index | Old Index