X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Faccesslog.c;h=88b61b3a889067922295b56703c97811f76077a7;hb=fd0303c3260c6397b33912312af67e7a99523926;hp=f17eebe0e8bc09c5049fd4d661779b413025d4ef;hpb=f95bc20584e36b777421070bb1cfd450349fac4d;p=ashd.git diff --git a/src/accesslog.c b/src/accesslog.c index f17eebe..88b61b3 100644 --- a/src/accesslog.c +++ b/src/accesslog.c @@ -46,8 +46,10 @@ static char *format; static struct timeval now; static volatile int reopen = 0; -static void qputs(char *s, FILE *o) +static void qputs(char *sp, FILE *o) { + unsigned char *s = (unsigned char *)sp; + for(; *s; s++) { if(*s == '\"') { fputs("\\\"", o); @@ -58,7 +60,7 @@ static void qputs(char *s, FILE *o) } else if(*s == '\t') { fputs("\\t", o); } else if((*s < 32) || (*s >= 128)) { - fprintf(o, "\\x%02x", (int)(unsigned char)*s); + fprintf(o, "\\x%02x", (int)*s); } else { fputc(*s, o); }