From 473d6bd833c975fac74ca587ae00ecfa3e3d4b50 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Wed, 2 Feb 2011 14:01:07 +0000 Subject: [PATCH] Support for IPv6 addresses in Dansguardian's log The buffer to hold an IP address read from Dansguardian's log wasn't big enough to contain an IPv6 address. The reading of such log was failing. --- dansguardian_log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dansguardian_log.c b/dansguardian_log.c index 69c077f..081b40b 100644 --- a/dansguardian_log.c +++ b/dansguardian_log.c @@ -37,7 +37,7 @@ void dansguardian_log(void) char year[10], mon[10], day[10]; char hour[15]; char user[MAXLEN], code1[255], code2[255]; - char ip[30]; + char ip[45]; char wdata[127]; char *url; char tmp6[MAXLEN]; @@ -119,7 +119,7 @@ void dansguardian_log(void) if (strcmp(user,"-") == 0) { strcpy(user,ip); - bzero(ip, 30); + ip[0]='\0'; } fprintf(fp_ou,"%s\t%d\t%s\t%s\t%s\t%s\t%s\n",user,idata,hour,ip,url,code1,code2); dansguardian_count++; -- 2.47.2