[Goodies-commits] r4011 - xfbib/trunk/src

David Gustafsson tssj at xfce.org
Fri Feb 29 22:07:35 CET 2008


Author: tssj
Date: 2008-02-29 21:07:35 +0000 (Fri, 29 Feb 2008)
New Revision: 4011

Modified:
   xfbib/trunk/src/strings.c
Log:
Fixed a bug in the functions change_value and change_variable


Modified: xfbib/trunk/src/strings.c
===================================================================
--- xfbib/trunk/src/strings.c	2008-02-29 20:40:46 UTC (rev 4010)
+++ xfbib/trunk/src/strings.c	2008-02-29 21:07:35 UTC (rev 4011)
@@ -44,21 +44,24 @@
 	fprintf(file, "@String {%s = \"%s\"}\n\n", s->variable, s->value);
 }
 
-static void change(char *old, char *new)
+void change_variable(struct string *s,char *variable) 
 {
-	free(old);
-	if ((old = strdup(new)) == NULL)
+	_DEBUG(("change_variable"));
+	free(s->variable);
+	if ((s->variable = strdup(variable)) == NULL) {
+		
 		fprintf(stderr, "Insufficient amount of memory available\n");
+	}
 }
 
-void change_variable(struct string *s,char *variable) 
-{
-	change(s->variable, variable);
-}
-
 void change_value(struct string *s, char *value)
 {
-	change(s->value, value);
+	_DEBUG(("change_value"));
+	free(s->value);
+	if ((s->value = strdup(value)) == NULL) {
+		
+		fprintf(stderr, "Insufficient amount of memory available\n");
+	}
 }
 
 void free_string(struct string *s)




More information about the Goodies-commits mailing list