sprintf(buf, "<TITLE>%s</TITLE>\n<H1>%s</H1><P>\n", r->status_line, r->status_line); b = buf + strlen(buf);
b = buf + SPRINTF4(buf, "<TITLE>%s</TITLE>\n<H1>%s</H1><P>\n", r->status_line, r->status_line);
int prepare_reply(struct request *r){	struct pool *p = r->cn->output;	static char buf[PATHLEN];	int send_message = r->method != M_HEAD;	switch (r->status) {	case 200:		r->status_line = "200 OK";		send_message = 0;		break;	case 204:		r->status_line = "204 No Content";		send_message = 0;		break;	case 302:		r->status_line = "302 Moved";		break;	case 304:		r->status_line = "304 Not Modified";		send_message = 0;		break;	case 400:		r->status_line = "400 Bad Request";		break;	case 403:		r->status_line = "403 Forbidden";		break;	case 404:		r->status_line = "404 Not Found";		break;	case 501:		r->status_line = "501 Not Implemented";		break;	case 503:		r->status_line = "503 Service Unavailable";		break;	default:		r->status_line = "500 Internal Server Error";		break;	}	if (r->error) {		log(L_WARNING, "* %s (%s)", r->status_line, r->error);		if (r->url)			log(L_WARNING, "  url:   %s", r->url);		if (r->host)			log(L_WARNING, "  host:  %s", r->host);		if (r->user_agent)			log(L_WARNING, "  agent: %s", r->user_agent);		if (r->referer)			log(L_WARNING, "  ref:   %s", r->referer);		log(L_WARNING, "  peer:  %s\n", r->cn->ip);	}	if (send_message) {		char *b;		sprintf(buf, "<TITLE>%s</TITLE>\n<H1>%s</H1><P>\n",				r->status_line, r->status_line);		b = buf + strlen(buf);		switch (r->status) {		case 302:			sprintf(b,				"The document has moved to URL "				"<A HREF=\"%s\">%s</A>.\n",				r->location, r->location);			break;		case 400:			sprintf(b,				"Your request contained the following error:\n"				"<P><B>%s</B>\n",				r->error);			break;		case 403:			sprintf(b,				"Access to URL %s denied on this server.\n",				r->url);			break;		case 404:			sprintf(b,				"The URL %s was not found on this server.\n",				r->url);			break;		case 501:			sprintf(b,				"Cannot apply %s method to URL %s\n",				r->method_s,				r->url);			break;		case 503:			sprintf(b,				"Server overloaded. Sorry.\n");			break;		default:			sprintf(b,				"<B>%s</B>\n",				r->error ? r->error : se_unknown);			if (admin)				sprintf(b,					"<P>Please notify %s of this error.\n",					admin);			break;		}		b += strlen(b);		sprintf(b, "%s\n", ERROR_FOOTER);		r->content_length = strlen(buf);		r->num_content = 0;		r->content_type = "text/html";	}	return (output_headers(p, r) == -1		|| (send_message && putstrings(p, 1, buf) == -1)) ? -1 : 0;}