From: Frédéric Marchal Date: Mon, 16 Jul 2012 10:42:40 +0000 (+0200) Subject: Put quotes around the IP address reported in the messages X-Git-Tag: v2.3.3~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52e095f106c93015b0e0f127300ed49886e74017;p=thirdparty%2Fsarg.git Put quotes around the IP address reported in the messages It makes the message easier to read if the parsing went really wrong and garbage is in the IP address. --- diff --git a/ip2name_dns.c b/ip2name_dns.c index 09f563f..f7a36c5 100644 --- a/ip2name_dns.c +++ b/ip2name_dns.c @@ -90,7 +90,7 @@ static enum ip2name_retcode ip2name_dns(char *ip,int ip_len) if (error==EAI_NONAME) return(INRC_NotFound); if (error!=0) { - debuga(_("IP to name resolution (getnameinfo) on IP address %s failed with error %d - %s\n"),ip,error,gai_strerror(error)); + debuga(_("IP to name resolution (getnameinfo) on IP address \"%s\" failed with error %d - %s\n"),ip,error,gai_strerror(error)); return(INRC_Error); } safe_strcpy(ip,host,ip_len); diff --git a/ip2name_exec.c b/ip2name_exec.c index f18d226..30b237a 100644 --- a/ip2name_exec.c +++ b/ip2name_exec.c @@ -92,7 +92,7 @@ static enum ip2name_retcode ip2name_exec(char *ip,int ip_len) for (i=0 ; i=sizeof(cmd)) { - debuga(_("IP address %s too long for the command to run\n"),ip); + debuga(_("IP address \"%s\" too long for the command to run\n"),ip); return(INRC_Error); } strcpy(cmd+j,ip); @@ -100,7 +100,7 @@ static enum ip2name_retcode ip2name_exec(char *ip,int ip_len) i+=2; } else { if (j>=sizeof(cmd)) { - debuga(_("IP address %.*s too long for the command to run\n"),ip_len,ip); + debuga(_("IP address \"%.*s\" too long for the command to run\n"),ip_len,ip); return(INRC_Error); } cmd[j++]=ExecCmd[i];