changeset 27267:46e182c1c14f

merge of '4296be52d5b80da450d41464433feee7c438d8f9' and 'c9200b58a3e76e0eb7e693c9262158bbad8a8afc'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 03 Jul 2009 06:03:01 +0000
parents 1e91cc59ab3d (diff) 5afc3577b8cd (current diff)
children c0075538109b
files
diffstat 1 files changed, 1 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkprefs.c	Fri Jul 03 05:27:32 2009 +0000
+++ b/pidgin/gtkprefs.c	Fri Jul 03 06:03:01 2009 +0000
@@ -1636,67 +1636,13 @@
 	return ret;
 }
 
-/* This isn't a very strict check, but should give the user a clue. */
-static gboolean
-verify_ip_address(const gchar *text)
-{
-	char *tmp;
-	long octet;
-
-	if (!text && !isdigit(*text))
-		return FALSE;
-
-	tmp = NULL;
-	octet = strtol(text, &tmp, 10);
-	if (octet < 0 || octet > 255)
-		return FALSE;
-
-	if (!tmp || *tmp != '.')
-		return FALSE;
-
-	text = tmp + 1;
-	if (!isdigit(*text))
-		return FALSE;
-
-	tmp = NULL;
-	octet = strtol(text, &tmp, 10);
-	if (octet < 0 || octet > 255)
-		return FALSE;
-
-	if (!tmp || *tmp != '.')
-		return FALSE;
-
-	text = tmp + 1;
-	if (!isdigit(*text))
-		return FALSE;
-
-	tmp = NULL;
-	octet = strtol(text, &tmp, 10);
-	if (octet < 0 || octet > 255)
-		return FALSE;
-
-	text = tmp + 1;
-	if (!isdigit(*text))
-		return FALSE;
-
-	tmp = NULL;
-	octet = strtol(text, &tmp, 10);
-	if (octet < 0 || octet > 255)
-		return FALSE;
-
-	if (!tmp || *tmp != '\0')
-		return FALSE;
-
-	return TRUE;
-}
-
 static void
 network_ip_changed(GtkEntry *entry, gpointer data)
 {
 	const gchar *text = gtk_entry_get_text(entry);
 	GdkColor color;
 
-	if (verify_ip_address(text))
+	if (purple_ip_address_is_valid(text))
 	{
 		color.red = 0xAFFF;
 		color.green = 0xFFFF;