summaryrefslogtreecommitdiff
path: root/tools/common.c
diff options
context:
space:
mode:
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;