summaryrefslogtreecommitdiff
blob: 570bc4018993693eb334d7cd8f0789e520d4b207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
--- clara-20031214.orig/clara.c
+++ clara-20031214/clara.c
@@ -751,11 +751,12 @@
     s[128] = 0;
     logmsg(s);
 
-    if (!trace)
-        return;
-    va_start(args,m);
-    vfprintf(stderr,m,args);
-    fprintf(stderr,"\n");
+    if (trace) {
+        vfprintf(stderr,m,args);
+        fprintf(stderr,"\n");
+    }
+
+    va_end(args);
 }
 
 /*
@@ -775,10 +776,12 @@
     logmsg(s);
 
     /* send to stderr if requested */
-    if (!debug)
-        return;
-    vfprintf(stderr,m,args);
-    fprintf(stderr,"\n");
+    if (debug) {
+        vfprintf(stderr,m,args);
+        fprintf(stderr,"\n");
+    }
+
+    va_end(args);
 }
 
 /*
@@ -797,9 +800,10 @@
     s[128] = 0;
     logmsg(s);
 
-    va_start(args,m);
     vfprintf(stderr,m,args);
     fprintf(stderr,"\n");
+
+    va_end(args);
 }
 
 /* (devel)
--- clara-20031214.orig/event.c
+++ clara-20031214/event.c
@@ -638,6 +638,8 @@
         }
     }
 
+    va_end(args);
+
 /*
     printf("request (priority %d, mclip=%d, redraw=%d) to draw the message \"%s\"\n",f,mclip,redraw_stline,s);
 */
--- clara-20031214.orig/html.c
+++ clara-20031214/html.c
@@ -1548,11 +1548,12 @@
     va_list args;
     int n=0,f;
 
-    va_start(args, fmt);
     for (f=0; f==0; ) {
 
         /* try to write */
+        va_start(args, fmt);
         n = vsnprintf(*t+*top+1,*sz-*top-1,fmt,args);
+        va_end(args);
 
         /*
             Some implementations of vsnprintf return -1 when
@@ -1589,11 +1590,12 @@
     va_list args;
     int n=0,f;
 
-    va_start(args, fmt);
     for (f=0; f==0; ) {
 
         /* try to write */
+        va_start(args, fmt);
         n = vsnprintf(text+topt+1,textsz-topt-1,fmt,args);
+        va_end(args);
 
         /*
             Some implementations of vsnprintf return -1 when