diff src/util.c @ 26:b9e90a914e20

[gaim-migrate @ 35] Peter Teichman sent me another huge list of patches. Here they are :) committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 24 Mar 2000 19:17:34 +0000
parents c56db1b46b0d
children dead1eb6d654
line wrap: on
line diff
--- a/src/util.c	Fri Mar 24 08:55:32 2000 +0000
+++ b/src/util.c	Fri Mar 24 19:17:34 2000 +0000
@@ -492,6 +492,8 @@
                 c++;
         }
         woo[cnt]='\0';
+
+	g_free (cpy);
         return woo;
 }
 
@@ -617,12 +619,14 @@
         char *t, *u;
         int x=0;
 
-        u = t = g_malloc(strlen(s) + 1);
+        g_return_if_fail (s != NULL);
+
+        u = t = g_strdup(s);
 
         strcpy(t, s);
         g_strdown(t);
         
-	while(*t) {
+	while(*t && (x < BUF_LEN - 1)) {
 		if (*t != ' ') {
 			buf[x] = *t;
 			x++;