Mercurial > pidgin.yaz
comparison libpurple/util.c @ 22884:fdda2b8a4146
propagate from branch 'im.pidgin.pidgin' (head e4cc3b79eb04e4937c5fa764f6839a8e07397651)
to branch 'im.pidgin.pidgin.custom_smiley' (head ddcc6eb918167735a0768b1a2976c95b5b15e213)
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 05 Mar 2008 17:18:09 +0000 |
parents | bb1dc0095856 51e740d3af3b |
children | 48e33e3673e2 |
comparison
equal
deleted
inserted
replaced
22883:09f426ca9ca7 | 22884:fdda2b8a4146 |
---|---|
4137 if (*(c - 1) == '-') return FALSE; | 4137 if (*(c - 1) == '-') return FALSE; |
4138 | 4138 |
4139 return ((c - domain) > 3 ? TRUE : FALSE); | 4139 return ((c - domain) > 3 ? TRUE : FALSE); |
4140 } | 4140 } |
4141 | 4141 |
4142 gboolean | |
4143 purple_ip_address_is_valid(const char *ip) | |
4144 { | |
4145 int c, o1, o2, o3, o4; | |
4146 char end; | |
4147 c = sscanf(ip, "%d.%d.%d.%d%c", &o1, &o2, &o3, &o4, &end); | |
4148 if (c != 4 || o1 < 0 || o1 > 255 || o2 < 0 || o2 > 255 || o3 < 0 || o3 > 255 || o4 < 0 || o4 > 255) | |
4149 return FALSE; | |
4150 return TRUE; | |
4151 } | |
4152 | |
4142 /* Stolen from gnome_uri_list_extract_uris */ | 4153 /* Stolen from gnome_uri_list_extract_uris */ |
4143 GList * | 4154 GList * |
4144 purple_uri_list_extract_uris(const gchar *uri_list) | 4155 purple_uri_list_extract_uris(const gchar *uri_list) |
4145 { | 4156 { |
4146 const gchar *p, *q; | 4157 const gchar *p, *q; |