Mercurial > pidgin.yaz
diff libpurple/protocols/gg/lib/pubdir50.c @ 32094:380f530c3f86
merged from im.pidgin.pidgin
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 07 Jun 2011 13:42:47 +0900 |
parents | 8b9e9c61d061 3a90a59ddea2 |
children | 4a34689eeb33 |
line wrap: on
line diff
--- a/libpurple/protocols/gg/lib/pubdir50.c Thu Apr 21 20:36:02 2011 +0900 +++ b/libpurple/protocols/gg/lib/pubdir50.c Tue Jun 07 13:42:47 2011 +0900 @@ -32,6 +32,7 @@ #include <glib.h> #include "libgadu.h" +#include "libgadu-config.h" #include "libgadu-internal.h" #include "encoding.h" @@ -95,7 +96,7 @@ return 0; } - + if (!(dupfield = strdup(field))) { gg_debug(GG_DEBUG_MISC, "// gg_pubdir50_add_n() out of memory\n"); free(dupvalue); @@ -150,7 +151,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; @@ -175,7 +176,7 @@ if (!s) return; - + for (i = 0; i < s->entries_count; i++) { free(s->entries[i].field); free(s->entries[i].value); @@ -203,7 +204,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; @@ -220,7 +221,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; @@ -328,7 +329,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) { @@ -385,7 +386,7 @@ } value = NULL; - + for (p = field; p < end; p++) { /* jeśli mamy koniec tekstu... */ if (!*p) { @@ -400,7 +401,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 */ @@ -437,10 +438,10 @@ free(tmp); } } - } + } res->count = num + 1; - + return 0; failure: