Mercurial > pidgin
diff libpurple/protocols/gg/lib/pubdir50.c @ 31620:3a90a59ddea2
Update libgadu to 0.11.0 plus local changes; thanks to Tomasz Wasilczyk.
Fixes 14248
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Sun, 05 Jun 2011 01:28:53 +0000 |
parents | 93b08d43f684 |
children | ef01f180114b |
line wrap: on
line diff
--- a/libpurple/protocols/gg/lib/pubdir50.c Tue May 24 01:48:26 2011 +0000 +++ b/libpurple/protocols/gg/lib/pubdir50.c Sun Jun 05 01:28:53 2011 +0000 @@ -31,6 +31,7 @@ #include <time.h> #include "libgadu.h" +#include "libgadu-config.h" #include "libgadu-internal.h" #include "encoding.h" @@ -94,7 +95,7 @@ return 0; } - + if (!(dupfield = strdup(field))) { gg_debug(GG_DEBUG_MISC, "// gg_pubdir50_add_n() out of memory\n"); free(dupvalue); @@ -149,7 +150,7 @@ int gg_pubdir50_seq_set(gg_pubdir50_t req, uint32_t seq) { gg_debug(GG_DEBUG_FUNCTION, "** gg_pubdir50_seq_set(%p, %d);\n", req, seq); - + if (!req) { gg_debug(GG_DEBUG_MISC, "// gg_pubdir50_seq_set() invalid arguments\n"); errno = EFAULT; @@ -174,7 +175,7 @@ if (!s) return; - + for (i = 0; i < s->entries_count; i++) { free(s->entries[i].field); free(s->entries[i].value); @@ -202,7 +203,7 @@ struct gg_pubdir50_request *r; gg_debug_session(sess, GG_DEBUG_FUNCTION, "** gg_pubdir50(%p, %p);\n", sess, req); - + if (!sess || !req) { gg_debug_session(sess, GG_DEBUG_MISC, "// gg_pubdir50() invalid arguments\n"); errno = EFAULT; @@ -219,7 +220,7 @@ /* wyszukiwanie bierze tylko pierwszy wpis */ if (req->entries[i].num) continue; - + if (sess->encoding == GG_ENCODING_CP1250) { size += strlen(req->entries[i].field) + 1; size += strlen(req->entries[i].value) + 1; @@ -327,7 +328,7 @@ struct gg_pubdir50_reply *r = (struct gg_pubdir50_reply*) packet; gg_pubdir50_t res; int num = 0; - + gg_debug(GG_DEBUG_FUNCTION, "** gg_pubdir50_handle_reply_sess(%p, %p, %p, %d);\n", sess, e, packet, length); if (!sess || !e || !packet) { @@ -384,7 +385,7 @@ } value = NULL; - + for (p = field; p < end; p++) { /* jeśli mamy koniec tekstu... */ if (!*p) { @@ -399,7 +400,7 @@ break; } } - + /* sprawdźmy, czy pole nie wychodzi poza pakiet, żeby nie * mieć segfaultów, jeśli serwer przestanie zakańczać pakietów * przez \0 */ @@ -436,10 +437,10 @@ free(tmp); } } - } + } res->count = num + 1; - + return 0; failure: