changeset 7804:622c9149609c

[gaim-migrate @ 8451] robot101 claims this is better committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 08 Dec 2003 03:51:33 +0000
parents ec291c2cad6a
children 5f0bb52c0609
files src/gtkutils.c src/util.c
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkutils.c	Mon Dec 08 01:42:55 2003 +0000
+++ b/src/gtkutils.c	Mon Dec 08 03:51:33 2003 +0000
@@ -1043,6 +1043,9 @@
 	GData *attribs;
 	const char *tmp, *start, *end;
 
+	g_return_if_fail(message != NULL);
+	g_return_if_fail(   list != NULL);
+
 	tmp = message;
 	while (gaim_markup_find_tag("img", tmp, &start, &end, &attribs)) {
 		GaimStoredImage *image = NULL;
--- a/src/util.c	Mon Dec 08 01:42:55 2003 +0000
+++ b/src/util.c	Mon Dec 08 03:51:33 2003 +0000
@@ -438,8 +438,17 @@
 	gboolean in_tag = FALSE;
 	gboolean in_attr = FALSE;
 	const char *in_quotes = NULL;
-	size_t needlelen = strlen(needle);
+	size_t needlelen;
 
+	g_return_val_if_fail(    needle != NULL, FALSE);
+	g_return_val_if_fail(   *needle != '\0', FALSE);
+	g_return_val_if_fail(  haystack != NULL, FALSE);
+	g_return_val_if_fail( *haystack != '\0', FALSE);
+	g_return_val_if_fail(     start != NULL, FALSE);
+	g_return_val_if_fail(       end != NULL, FALSE);
+	g_return_val_if_fail(attributes != NULL, FALSE);
+
+	needlelen = strlen(needle);
 	g_datalist_init(&attribs);
 
 	while (*cur && !found) {
@@ -537,11 +546,15 @@
 				if (*cur == ' ' || *cur == '>') {
 					in_tag = TRUE;
 				} else {
-					while (*cur && *cur != '"' && *cur != '>') {
+					while (*cur && *cur != '"' && *cur != '\'' && *cur != '>') {
 						if (*cur == '"') {
 							cur++;
 							while (*cur && *cur != '"')
 								cur++;
+						} else if (*cur == '\'') {
+							cur++;
+							while (*cur && *cur != '\'')
+								cur++;
 						} else {
 							cur++;
 						}