gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/libbase log.cpp


From: Vitaly Alexeev
Subject: [Gnash-commit] gnash/libbase log.cpp
Date: Sat, 27 May 2006 18:27:54 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         
Changes by:     Vitaly Alexeev <address@hidden> 06/05/27 18:27:54

Modified files:
        libbase        : log.cpp 

Log message:
        fixed va_start bug.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/libbase/log.cpp.diff?tr1=1.7&tr2=1.8&r1=text&r2=text

Patches:
Index: gnash/libbase/log.cpp
diff -u gnash/libbase/log.cpp:1.7 gnash/libbase/log.cpp:1.8
--- gnash/libbase/log.cpp:1.7   Thu May 25 12:35:52 2006
+++ gnash/libbase/log.cpp       Sat May 27 18:27:54 2006
@@ -144,25 +144,33 @@
 void
 log_msg(const char* fmt, ...)
 {
-       return;
     va_list ap;
-    char tmp[BUFFER_SIZE];
-    memset(tmp, 0, BUFFER_SIZE);
+               char tmp[BUFFER_SIZE];
+
+               // Vitaly: 
+               //      macro 'va_start' sets 'ap' to beginning of list of 
optional arguments 
+               //      newfmt is not those
+
+    //memset(tmp, 0, BUFFER_SIZE);
     
     // Drop any newlines on the end of the string. We'll supply
     // endl later so it works correctly anyway.
 
-    char *newfmt = strdup(fmt);
-    char *ptr = strrchr(newfmt, '\n');
-               if (ptr)
-               {
-                       *ptr = 0;
-               }
-
-    va_start (ap, newfmt);
-    vsnprintf (tmp, BUFFER_SIZE, newfmt, ap);
-    free(newfmt);
-    dbglogfile << tmp << endl;
+    //char *newfmt = strdup(fmt);
+    //char *ptr = strrchr(newfmt, '\n');
+               //if (ptr)
+               //{
+               //      *ptr = 0;
+               //}
+
+    //va_start (ap, newfmt);
+    //vsnprintf (tmp, BUFFER_SIZE, newfmt, ap);
+    //free(newfmt);
+
+    va_start (ap, fmt);
+    vsnprintf (tmp, BUFFER_SIZE, fmt, ap);
+
+               dbglogfile << tmp << endl;
     
     va_end (ap);
 }




reply via email to

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