From fba57c10d9f9552c9c31c20283147348789ef650 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 4 Jan 2014 19:26:46 +0000 Subject: some code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@7499 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Gadu-Gadu/src/libgadu/common.c | 10 +++++----- protocols/Gadu-Gadu/src/libgadu/dcc7.c | 2 +- protocols/Gadu-Gadu/src/libgadu/pubdir.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'protocols/Gadu-Gadu/src/libgadu') diff --git a/protocols/Gadu-Gadu/src/libgadu/common.c b/protocols/Gadu-Gadu/src/libgadu/common.c index b9b41c0547..f1db6c4b7f 100644 --- a/protocols/Gadu-Gadu/src/libgadu/common.c +++ b/protocols/Gadu-Gadu/src/libgadu/common.c @@ -366,7 +366,7 @@ char *gg_read_line(SOCKET sock, char *buf, int length) * * \ingroup helper */ -#ifdef GG_CONFIG_MIRANDA +#ifdef GG_CONFIG_MIRANDA SOCKET gg_connect_internal(void *addr, int port, int async, SOCKET *gg_sock) #else SOCKET gg_connect(void *addr, int port, int async) @@ -398,8 +398,8 @@ SOCKET gg_connect(void *addr, int port, int async) return -1; } -#ifdef GG_CONFIG_MIRANDA - if (gg_sock) *gg_sock = sock; +#ifdef GG_CONFIG_MIRANDA + if (gg_sock) *gg_sock = sock; #endif if (async) { @@ -435,7 +435,7 @@ SOCKET gg_connect(void *addr, int port, int async) return sock; } -#ifdef GG_CONFIG_MIRANDA +#ifdef GG_CONFIG_MIRANDA SOCKET gg_connect(void *addr, int port, int async) { return gg_connect_internal(addr, port, async, 0); @@ -541,7 +541,7 @@ int gg_http_hash(const char *format, ...) char *arg, buf[16]; if (format[j] == 'u') { - snprintf(buf, sizeof(buf), "%d", va_arg(ap, uin_t)); + mir_snprintf(buf, sizeof(buf), "%d", va_arg(ap, uin_t)); arg = buf; } else { if (!(arg = va_arg(ap, char*))) diff --git a/protocols/Gadu-Gadu/src/libgadu/dcc7.c b/protocols/Gadu-Gadu/src/libgadu/dcc7.c index f3813e6e83..fcfefa0500 100644 --- a/protocols/Gadu-Gadu/src/libgadu/dcc7.c +++ b/protocols/Gadu-Gadu/src/libgadu/dcc7.c @@ -330,7 +330,7 @@ static int gg_dcc7_listen_and_send_info(struct gg_dcc7 *dcc) // we MUST fill hash to recive from server request for server connection //snprintf((char*) pkt.hash, sizeof(pkt.hash), "0"); count = dcc->local_addr + external_port * rand(); - snprintf((char*) pkt.hash, sizeof(pkt.hash), "%d", count); + mir_snprintf(pkt.hash, sizeof(pkt.hash), "%d", count); return gg_send_packet(dcc->sess, GG_DCC7_INFO, &pkt, sizeof(pkt), NULL); } diff --git a/protocols/Gadu-Gadu/src/libgadu/pubdir.c b/protocols/Gadu-Gadu/src/libgadu/pubdir.c index f9d656dfe3..c74ff4f309 100644 --- a/protocols/Gadu-Gadu/src/libgadu/pubdir.c +++ b/protocols/Gadu-Gadu/src/libgadu/pubdir.c @@ -735,7 +735,7 @@ int gg_token_watch_fd(struct gg_http *h) gg_debug(GG_DEBUG_MISC, "=> token body \"%s\"\n", h->body); - if (h->body && (!(url = malloc(strlen(h->body))) || !(tokenid = malloc(strlen(h->body))))) { + if (h->body && (!(url = (char*)malloc(strlen(h->body) + 1)) || !(tokenid = (char*)malloc(strlen(h->body) + 1)))) { gg_debug(GG_DEBUG_MISC, "=> token, not enough memory for results\n"); free(url); return -1; -- cgit v1.2.3