libpurple/protocols/gg/utils.c

changeset 35144
3590ceb242b5
parent 34429
f0ae13a29cdf
child 35357
389e413e3414
equal deleted inserted replaced
35143:7847eb4b93b0 35144:3590ceb242b5
188 g_free(str_array); 188 g_free(str_array);
189 189
190 return joined; 190 return joined;
191 } 191 }
192 192
193 const gchar * ggp_ipv4_to_str(uint32_t raw_ip)
194 {
195 static gchar buff[INET_ADDRSTRLEN];
196 buff[0] = '\0';
197
198 g_snprintf(buff, sizeof(buff), "%d.%d.%d.%d",
199 ((raw_ip >> 0) & 0xFF),
200 ((raw_ip >> 8) & 0xFF),
201 ((raw_ip >> 16) & 0xFF),
202 ((raw_ip >> 24) & 0xFF));
203
204 return buff;
205 }
206
193 GList * ggp_list_truncate(GList *list, guint length, GDestroyNotify free_func) 207 GList * ggp_list_truncate(GList *list, guint length, GDestroyNotify free_func)
194 { 208 {
195 while (g_list_length(list) > length) 209 while (g_list_length(list) > length)
196 { 210 {
197 GList *last = g_list_last(list); 211 GList *last = g_list_last(list);

mercurial