|
@@ -17,6 +17,9 @@ void _cmErrVMsg(cmErr_t* err, bool warnFl, cmRC_t rc, const cmChar_t* fmt, va_li
|
17
|
17
|
{
|
18
|
18
|
if( err->rpt == NULL )
|
19
|
19
|
return;
|
|
20
|
+
|
|
21
|
+ va_list vl0;
|
|
22
|
+ va_copy(vl0,vl);
|
20
|
23
|
|
21
|
24
|
const cmChar_t* hdrFmt = warnFl ? "%s warning: " : "%s error: ";
|
22
|
25
|
const cmChar_t* codeFmt = " (RC:%i)";
|
|
@@ -26,11 +29,13 @@ void _cmErrVMsg(cmErr_t* err, bool warnFl, cmRC_t rc, const cmChar_t* fmt, va_li
|
26
|
29
|
int n2 = snprintf( NULL,0,codeFmt,rc);
|
27
|
30
|
int n = n0+n1+n2+1;
|
28
|
31
|
cmChar_t s[n];
|
|
32
|
+
|
29
|
33
|
n0 = snprintf(s,n,hdrFmt,cmStringNullGuard(err->label));
|
30
|
|
- n0 += vsnprintf(s+n0,n-n0,fmt,vl);
|
|
34
|
+ n0 += vsnprintf(s+n0,n-n0,fmt,vl0);
|
31
|
35
|
n0 += snprintf(s+n0,n-n0,codeFmt,rc);
|
32
|
36
|
assert(n0 <= n );
|
33
|
37
|
cmRptErrorf(err->rpt,"%s\n",s);
|
|
38
|
+ va_end(vl0);
|
34
|
39
|
}
|
35
|
40
|
|
36
|
41
|
void _cmErrMsg( cmErr_t* err, bool warnFl, cmRC_t rc, const cmChar_t* fmt, ... )
|