Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 86fc065d9fb2d74f29efaa8f960170a6 > files > 1

white_dune-0.28-1.pl12.2.1mdv2008.0.src.rpm

diff -ur 12/src/DuneApp.cpp 13/src/DuneApp.cpp
--- 12/src/DuneApp.cpp	2008-01-08 23:17:07.000000000 -0800
+++ 13/src/DuneApp.cpp	2008-01-08 23:18:00.000000000 -0800
@@ -518,7 +518,7 @@
 
     if (errors[0]) {
 	swMessageBox(_mainWnd, errors, "Parse Errors", SW_MB_OK, SW_MB_WARNING);
-	swDebugf(errors);
+        swDebugf("%s", errors);
         // delete so far successfull imported nodes on errors
         while ((scene->getUndoStackTop() > undoStackTopBeforeParse) &&
                scene->canUndo()) 
diff -ur 12/src/mysnprintf.h 13/src/mysnprintf.h
--- 12/src/mysnprintf.h	2008-01-08 23:17:23.000000000 -0800
+++ 13/src/mysnprintf.h	2008-01-08 23:18:17.000000000 -0800
@@ -1,3 +1,10 @@
+/*
+ * Copyright Patrick Powell 1995
+ * This code is based on code written by Patrick Powell (papowell@astart.com)
+ * It may be used for any purpose as long as this notice remains intact
+ * on all source code distributions
+ */
+
 #ifndef _BSD_SNPRINTF_H
 #define _BSD_SNPRINTF_H
 
@@ -8,7 +15,6 @@
  extern "C" 
 #endif
 int mysnprintf(char *str, const unsigned int count, const char *fmt, ...);
-/* int myvsnprintf(char *str, size_t count, const char *fmt, va_list args); */
 
 #ifdef WIN32
 #include <Windows.h>
@@ -41,6 +47,11 @@
 # endif
 #endif
 
+#ifndef MY_NO_C
+ extern "C" 
+#endif
+int myvsnprintf(char *str, size_t count, const char *fmt, va_list args);
+
 #ifndef MY_NO_C 
  extern "C" 
 #endif
diff -ur 12/src/Scene.cpp 13/src/Scene.cpp
--- 12/src/Scene.cpp	2008-01-08 23:17:15.000000000 -0800
+++ 13/src/Scene.cpp	2008-01-08 23:18:08.000000000 -0800
@@ -749,12 +749,15 @@
 void
 Scene::errorf(const char *fmt, ...)
 {
-    va_list	ap;
-    char	buf[1024], buf2[1024];
+    va_list ap;
+    char buf[1024], buf2[1024];
+    const char *url = "";  
 
     va_start(ap, fmt);
-    vsprintf(buf, fmt, ap);
-    sprintf(buf2, "%d:  %s", lineno, buf);
+    myvsnprintf(buf, 1024, fmt, ap);
+    if (TheApp->getImportURL() != NULL)
+        url = TheApp->getImportURL();
+    mysnprintf(buf2, 1024, "%s %d: %s", url, lineno, buf);
     _compileErrors += buf2;
 }
 
diff -ur 12/src/swt/motif/swt.c 13/src/swt/motif/swt.c
--- 12/src/swt/motif/swt.c	2008-01-08 23:17:42.000000000 -0800
+++ 13/src/swt/motif/swt.c	2008-01-08 23:18:30.000000000 -0800
@@ -2898,13 +2898,16 @@
 /* debugging output */
 /********************/
 
+
 extern void
 swDebugf(const char *fmt, ...)
 {
-    va_list     ap;
+    va_list ap;
+    char message[1024];
 
     va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
+    myvsnprintf(message, 1024, fmt, ap);
+    fprintf(stderr, "%s", message);
 }
 
 extern double