X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fresp.c;h=be2f7bd7c586f3046d6884c08c6276543ccf4d42;hb=eaefded0a959b59f441d50cfb30fc08497078fe1;hp=2c0fa835daaf8a969f88cd36d509952a47d9f842;hpb=51a4b1ad5f25ea29b94384e21c48152cce252b8b;p=ashd.git diff --git a/lib/resp.c b/lib/resp.c index 2c0fa83..be2f7bd 100644 --- a/lib/resp.c +++ b/lib/resp.c @@ -53,7 +53,7 @@ char *urlquote(char *text) bufinit(buf); for(; *text; text++) { c = *text; - if(!c < 128 && safechars[(int)c]) + if((c < 128) && safechars[(int)c]) bufadd(buf, *text); else bprintf(&buf, "%%%02X", (int)c); @@ -86,16 +86,12 @@ char *htmlquote(char *text) return(ret = buf.b); } -void simpleerror(int fd, int code, char *msg, char *fmt, ...) +static void simpleerror2v(FILE *out, int code, char *msg, char *fmt, va_list args) { struct charbuf buf; char *tmp; - va_list args; - FILE *out; - va_start(args, fmt); tmp = vsprintf2(fmt, args); - va_end(args); bufinit(buf); bufcatstr(buf, "\r\n"); bufcatstr(buf, "\r\n"); @@ -108,17 +104,36 @@ void simpleerror(int fd, int code, char *msg, char *fmt, ...) bprintf(&buf, "
%s
\r\n", htmlquote(tmp)); bufcatstr(buf, "