aboutsummaryrefslogtreecommitdiff
path: root/ncurses/trace/trace_xnames.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/trace/trace_xnames.c')
-rw-r--r--ncurses/trace/trace_xnames.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ncurses/trace/trace_xnames.c b/ncurses/trace/trace_xnames.c
index 38a48730ccdc..8d0eefb9d4f0 100644
--- a/ncurses/trace/trace_xnames.c
+++ b/ncurses/trace/trace_xnames.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1999-2000,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1999-2010,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -35,7 +35,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: trace_xnames.c,v 1.6 2010/01/23 17:59:27 tom Exp $")
+MODULE_ID("$Id: trace_xnames.c,v 1.7 2016/05/28 23:30:01 tom Exp $")
NCURSES_EXPORT(void)
_nc_trace_xnames(TERMTYPE *tp GCC_UNUSED)
@@ -43,8 +43,9 @@ _nc_trace_xnames(TERMTYPE *tp GCC_UNUSED)
#ifdef TRACE
#if NCURSES_XNAMES
int limit = tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings;
- int n, m;
+
if (limit) {
+ int n;
int begin_num = tp->ext_Booleans;
int begin_str = tp->ext_Booleans + tp->ext_Numbers;
@@ -53,7 +54,10 @@ _nc_trace_xnames(TERMTYPE *tp GCC_UNUSED)
limit,
tp->ext_Booleans, tp->ext_Numbers, tp->ext_Strings,
tp->num_Booleans, tp->num_Numbers, tp->num_Strings);
+
for (n = 0; n < limit; n++) {
+ int m;
+
if ((m = n - begin_str) >= 0) {
_tracef("[%d] %s = %s", n,
tp->ext_Names[n],