]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_printw.c
ncurses 5.9 - patch 20120303
[ncurses.git] / ncurses / base / lib_printw.c
index 963181d9a49437e45f541baabefc44c7ccc2f593..530e7134307ed5a1fdb1e273acf3738c8ffe86f0 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2012 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_printw.c,v 1.20 2009/10/24 22:07:03 tom Exp $")
+MODULE_ID("$Id: lib_printw.c,v 1.21 2012/02/29 10:11:53 Werner.Fink Exp $")
 
 NCURSES_EXPORT(int)
 printw(const char *fmt,...)
 
 NCURSES_EXPORT(int)
 printw(const char *fmt,...)
@@ -48,10 +48,12 @@ printw(const char *fmt,...)
     int code;
 
 #ifdef TRACE
     int code;
 
 #ifdef TRACE
-    va_start(argp, fmt);
+    va_list argq;
+    va_copy(argq, argp);
+    va_start(argq, fmt);
     T((T_CALLED("printw(%s%s)"),
     T((T_CALLED("printw(%s%s)"),
-       _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
-    va_end(argp);
+       _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
+    va_end(argq);
 #endif
 
     va_start(argp, fmt);
 #endif
 
     va_start(argp, fmt);
@@ -68,10 +70,12 @@ wprintw(WINDOW *win, const char *fmt,...)
     int code;
 
 #ifdef TRACE
     int code;
 
 #ifdef TRACE
-    va_start(argp, fmt);
+    va_list argq;
+    va_copy(argq, argp);
+    va_start(argq, fmt);
     T((T_CALLED("wprintw(%p,%s%s)"),
     T((T_CALLED("wprintw(%p,%s%s)"),
-       (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
-    va_end(argp);
+       (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
+    va_end(argq);
 #endif
 
     va_start(argp, fmt);
 #endif
 
     va_start(argp, fmt);
@@ -88,10 +92,12 @@ mvprintw(int y, int x, const char *fmt,...)
     int code;
 
 #ifdef TRACE
     int code;
 
 #ifdef TRACE
-    va_start(argp, fmt);
+    va_list argq;
+    va_copy(argq, argp);
+    va_start(argq, fmt);
     T((T_CALLED("mvprintw(%d,%d,%s%s)"),
     T((T_CALLED("mvprintw(%d,%d,%s%s)"),
-       y, x, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
-    va_end(argp);
+       y, x, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
+    va_end(argq);
 #endif
 
     if ((code = move(y, x)) != ERR) {
 #endif
 
     if ((code = move(y, x)) != ERR) {
@@ -109,10 +115,12 @@ mvwprintw(WINDOW *win, int y, int x, const char *fmt,...)
     int code;
 
 #ifdef TRACE
     int code;
 
 #ifdef TRACE
-    va_start(argp, fmt);
+    va_list argq;
+    va_copy(argq, argp);
+    va_start(argq, fmt);
     T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"),
     T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"),
-       y, x, (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
-    va_end(argp);
+       y, x, (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
+    va_end(argq);
 #endif
 
     if ((code = wmove(win, y, x)) != ERR) {
 #endif
 
     if ((code = wmove(win, y, x)) != ERR) {