bug-ncurses
[Top][All Lists]
Advanced

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

Minor bugs in trace mode


From: VCO
Subject: Minor bugs in trace mode
Date: Mon, 6 Jun 2011 23:35:19 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Hi,

I found 2 minor bugs in case ncurses is configured with option "--with-trace":

1. ncurses/base/lib_refresh.c
   wnoutrefresh crashes with SIGSEGV because inside the TRACE macro win is 
dereferenced

2. ./ncurses/widechar/lib_box_set.c
   wborder_set: The name in T_CALLED is wrong (should be "wborder_set", not 
"wborder")

Patches against ncurses-5.9-20110604 below.

Regards
   Vassili

--- 8< ---

--- lib_box_set.c.orig  2009-10-25 00:36:56.000000000 +0200
+++ lib_box_set.c       2011-05-13 23:14:24.000000000 +0200
@@ -52,7 +52,7 @@
     NCURSES_SIZE_T endx, endy;
     NCURSES_CH_T wls, wrs, wts, wbs, wtl, wtr, wbl, wbr;
 
-    T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"),
+    T((T_CALLED("wborder_set(%p,%s,%s,%s,%s,%s,%s,%s,%s)"),
        (void *) win,
        _tracech_t2(1, ls),
        _tracech_t2(2, rs),



--- lib_refresh.c.orig  2010-12-19 02:22:58.000000000 +0100
+++ lib_refresh.c       2011-05-13 23:08:20.000000000 +0200
@@ -90,12 +90,6 @@
 #endif
 
     T((T_CALLED("wnoutrefresh(%p)"), (void *) win));
-#ifdef TRACE
-    if (USE_TRACEF(TRACE_UPDATE)) {
-       _tracedump("...win", win);
-       _nc_unlock_global(tracef);
-    }
-#endif /* TRACE */
 
     /*
      * This function will break badly if we try to refresh a pad.
@@ -104,6 +98,13 @@
        || (win->_flags & _ISPAD))
        returnCode(ERR);
 
+#ifdef TRACE
+    if (USE_TRACEF(TRACE_UPDATE)) {
+       _tracedump("...win", win);
+       _nc_unlock_global(tracef);
+    }
+#endif /* TRACE */
+
     /* put them here so "win == 0" won't break our code */
     begx = win->_begx;
     begy = win->_begy;

-- 
V. Courzakis
email: address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]