Fix error messages when sending packet fails
authorRafał Miłecki <rafal@milecki.pl>
Wed, 15 Feb 2017 10:29:00 +0000 (11:29 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Wed, 15 Feb 2017 10:30:04 +0000 (11:30 +0100)
Use perror in both cases, fix copy & paste mistake, don't use extra ":".

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
dns.c

diff --git a/dns.c b/dns.c
index cf9e29b834659ea972c172e3506e340a9ad38048..7c49236a30cc27d6a99b9d5d7b88ea58fc89fd4f 100644 (file)
--- a/dns.c
+++ b/dns.c
@@ -99,7 +99,7 @@ dns_send_question(struct interface *iface, const char *question, int type, int m
 
        DBG(1, "Q <- %s %s\n", dns_type_string(type), question);
        if (interface_send_packet(iface, NULL, iov, ARRAY_SIZE(iov)) < 0)
-               perror("failed to send question :");
+               perror("failed to send question");
 }
 
 
@@ -178,7 +178,7 @@ dns_send_answer(struct interface *iface, struct sockaddr *to, const char *answer
        }
 
        if (interface_send_packet(iface, to, iov, n_iov) < 0)
-               fprintf(stderr, "failed to send question\n");
+               perror("failed to send answer");
 }
 
 void