From: Frédéric Marchal Date: Mon, 14 Dec 2009 08:04:08 +0000 (+0000) Subject: Ported r157 from branches/v2_2_6_1 (remove warnings if no libgd) X-Git-Tag: v2_2_7~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17c89803f0a95587006b0e867064a9ff9445835d;p=thirdparty%2Fsarg.git Ported r157 from branches/v2_2_6_1 (remove warnings if no libgd) --- diff --git a/ChangeLog b/ChangeLog index 2c0a13e..b4bcb72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ Dec-09-2009 Version 2.2.6.1 - Fix user agent report font size and statistics on user agent. - Test for the availability of -Werror=format-security in gcc (thanks to Maxim Britov). - Test the existence of bzero with autoconf and don't redefine it (tkanks to Maxim Britov). + - Remove warnings if libgd is not available. Oct-14-2009 Version 2.2.6 - Protection against buffer overflows in getword and friends and report the origin of the error instead of always blaming access.log. diff --git a/grepday.c b/grepday.c index 90dce44..aff71f0 100644 --- a/grepday.c +++ b/grepday.c @@ -26,6 +26,8 @@ #include "include/conf.h" #include "include/defs.h" +#if defined(HAVE_GD) && defined(HAVE_ICONV_H) && defined(gdFTEX_Unicode) + static int blue; static int white; static int lavender; @@ -39,7 +41,6 @@ static int black; //static char *font1 = FONTDIR"/FreeSans.ttf"; static char *font1 = FONTDIR"/DejaVuSans.ttf"; -#if defined(HAVE_GD) && defined(HAVE_ICONV_H) && defined(gdFTEX_Unicode) #include #define SARGgdImageStringFT I18NgdImageStringFT @@ -74,9 +75,9 @@ static char * I18NgdImageStringFT (gdImage * im, int *brect, int fg, char *fontl #define SARGgdImageStringFT gdImageStringFT #endif +#ifdef HAVE_GD static void bar(int x1,long long int n) { -#ifdef HAVE_GD gdPoint points[4]; int brect[8]; int val=0, x; @@ -226,12 +227,13 @@ static void bar(int x1,long long int n) points[3].y = 420; gdImageFilledPolygon(im, points, 4, color2); -#endif return; } +#endif void greport_day(const char *user) { +#ifdef HAVE_GD FILE *fp_in, *pngout; int x, y; int x1; @@ -252,8 +254,6 @@ void greport_day(const char *user) int cstatus; char s[15]; -#ifdef HAVE_GD - if(strcmp(Graphs,"yes") != 0) { unlink(wdirname); return;