Browse code

fix handling of special characters in mprintf (bb#360)

git-svn: trunk@2888

Tomasz Kojm authored on 2007/03/02 02:17:58
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Mar  1 16:21:48 CET 2007 (tk)
2
+---------------------------------
3
+  * shared/output.c: fix handling of special characters in mprintf (bb#360)
4
+
1 5
 Thu Mar  1 14:56:44 GMT 2007 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/mbox.c:	Fix bug 358
... ...
@@ -287,20 +287,20 @@ void mprintf(const char *str, ...)
287 287
     vsnprintf(buff, sizeof(buff), str, args);
288 288
     va_end(args);
289 289
 
290
-    if(buff[0] == '!') {
290
+    if(*str == '!') {
291 291
        if(!mprintf_stdout)
292 292
            fd = stderr;
293 293
 	fprintf(fd, "ERROR: %s", &buff[1]);
294
-    } else if(buff[0] == '@') {
294
+    } else if(*str == '@') {
295 295
        if(!mprintf_stdout)
296 296
            fd = stderr;
297 297
 	fprintf(fd, "ERROR: %s", &buff[1]);
298 298
     } else if(!mprintf_quiet) {
299
-	if(buff[0] == '^') {
299
+	if(*str == '^') {
300 300
            if(!mprintf_stdout)
301 301
                fd = stderr;
302 302
 	    fprintf(fd, "WARNING: %s", &buff[1]);
303
-	} else if(buff[0] == '*') {
303
+	} else if(*str == '*') {
304 304
 	    if(mprintf_verbose)
305 305
 		fprintf(fd, "%s", &buff[1]);
306 306
 	} else fprintf(fd, "%s", buff);