Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 53955843e81b1f369ad60b94ae20b253 > files > 1

xedit-1.0.2-7mdv2008.0.src.rpm

--- xedit-1.0.2/util.c.orig	2007-09-20 15:27:45.000000000 -0300
+++ xedit-1.0.2/util.c	2007-09-20 15:42:04.000000000 -0300
@@ -58,44 +58,15 @@ extern void _XawTextShowPosition(TextWid
 extern Widget scratch;
 extern Widget vpanes[2], labels[3], texts[3], forms[3];
 extern XawTextWrapMode wrapmodes[3];
-
-#ifndef va_copy
-# ifdef __va_copy
-#  define va_copy __va_copy
-# else
-#  error "no working va_copy was found"
-# endif
-#endif
     
 /*
  * Implementation
  */
 void
-XeditPrintf(const char *format, ...)
+XeditPrintf(char *str)
 {
-    char         *str;
-    size_t        size;
-    va_list       va,
-                  va2;
-    XawTextBlock  text;
-    XawTextPosition pos;
-    
-    va_start(va, format);
-
-    va_copy(va2, va);
-    size = vsnprintf(NULL, 0, format, va2);
-    va_end(va2);
-
-    str = (char *)malloc(size + 1);
-    if (str == NULL)
-        return;
-
-    vsnprintf(str, size + 1, format, va);
-    str[size] = 0;
-    
-    va_end(va);
-    
-    pos = XawTextSourceScan(XawTextGetSource(messwidget),
+    XawTextBlock text;
+    XawTextPosition pos = XawTextSourceScan(XawTextGetSource(messwidget),
 					    0, XawstAll, XawsdRight, 1, True);
 
     text.length = strlen(str);
@@ -106,8 +77,6 @@ XeditPrintf(const char *format, ...)
     XawTextReplace(messwidget, pos, pos, &text);
 
     XawTextSetInsertionPoint(messwidget, pos + text.length);
-    
-    free(str);
 }
 
 Widget
--- xedit-1.0.2/xedit.h.orig	2007-09-20 16:00:06.000000000 -0300
+++ xedit-1.0.2/xedit.h	2007-09-20 15:59:15.000000000 -0300
@@ -109,7 +109,7 @@ extern Boolean line_edit;
 void Feep(void);
 
 /*	externals in util.c 	*/
-void XeditPrintf(const char *format, ...);
+void XeditPrintf(char *str);
 Widget MakeCommandButton(Widget, char*, XtCallbackProc);
 Widget MakeStringBox(Widget, String, String);
 String GetString(Widget);