summaryrefslogtreecommitdiff
path: root/tools/common.c
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2012-05-24 12:50:03 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2012-05-24 12:50:03 -0700
commit09cdaf8ce729b99c134c5a01ad7ab081fa7d5b8d (patch)
tree7dbaf1b0ccf1805e8821caf8aaee9fd9471c66db /tools/common.c
parent7a74c3574afb32ab31dc5f946afbf89f3022a36d (diff)
parent16341eb2140c848bd549a112960164bd11924e85 (diff)
downloadrabbitmq-c-github-ask-09cdaf8ce729b99c134c5a01ad7ab081fa7d5b8d.tar.gz
Merge pull request #20 from alanxz/cmake_build_improvements
CMake build system improvements
Diffstat (limited to 'tools/common.c')
-rw-r--r--tools/common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/common.c b/tools/common.c
index 2c248b9..70f3bca 100644
--- a/tools/common.c
+++ b/tools/common.c
@@ -34,6 +34,8 @@
#include "config.h"
#endif
+/* needed for asnprintf */
+#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -200,12 +202,13 @@ static void init_connection_info(struct amqp_connection_info *ci)
"Parsing URL '%s'", amqp_url);
if (amqp_server) {
+ char *colon;
if (ci->host)
die("both --server and --url options specify"
" server host");
/* parse the server string into a hostname and a port */
- char *colon = strchr(amqp_server, ':');
+ colon = strchr(amqp_server, ':');
if (colon) {
char *port_end;
size_t host_len;