]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Put quotes around the IP address reported in the messages
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 16 Jul 2012 10:42:40 +0000 (12:42 +0200)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 16 Jul 2012 10:42:40 +0000 (12:42 +0200)
It makes the message easier to read if the parsing went really wrong and
garbage is in the IP address.

ip2name_dns.c
ip2name_exec.c

index 09f563fff7cec56287919431a5180d4a77f48259..f7a36c51fd80cec2230a2d4d020a5dc2b3e7ac30 100644 (file)
@@ -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);
index f18d22643b9734e6f4e85f1f87729ad7ff3b1646..30b237a6f497fb3d8778549272c8981a260ab771 100644 (file)
@@ -92,7 +92,7 @@ static enum ip2name_retcode ip2name_exec(char *ip,int ip_len)
        for (i=0 ; i<sizeof(ExecCmd) && ExecCmd[i] ; i++) {
                if (ExecCmd[i]=='%' && strncmp(ExecCmd+i+1,"IP",2)==0) {
                        if (j+len>=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];