From: Nick Mathewson Date: Wed, 7 Nov 2007 07:33:21 +0000 (+0000) Subject: r16507@catbus: nickm | 2007-11-07 01:34:55 -0500 X-Git-Tag: release-2.0.1-alpha~520 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7feba57010f4d5024083abc055864f292f9a6063;p=libevent r16507@catbus: nickm | 2007-11-07 01:34:55 -0500 Never assign a string constant to a non-const char *. svn:r495 --- diff --git a/event.h b/event.h index 6d9c3db9..6af47206 100644 --- a/event.h +++ b/event.h @@ -251,7 +251,7 @@ TAILQ_HEAD (evkeyvalq, evkeyval); #endif /* _EVENT_DEFINED_TQENTRY */ struct eventop { - char *name; + const char *name; void *(*init)(struct event_base *); int (*add)(void *, struct event *); int (*del)(void *, struct event *); diff --git a/http.c b/http.c index 3e53a90c..d190f0c4 100644 --- a/http.c +++ b/http.c @@ -438,7 +438,8 @@ evhttp_hostportfile(char *url, char **phost, u_short *pport, char **pfile) { static char host[1024]; static char file[1024]; - char *p, *p2; + char *p; + const char *p2; int len; u_short port; @@ -1617,7 +1618,7 @@ evhttp_send_done(struct evhttp_connection *evcon, void *arg) void evhttp_send_error(struct evhttp_request *req, int error, const char *reason) { - char *fmt = "\n" + const char *fmt = "\n" "%d %s\n" "\n" "

Method Not Implemented

\n" @@ -1915,7 +1916,7 @@ evhttp_handle_request(struct evhttp_request *req, void *arg) return; } else { /* We need to send a 404 here */ - char *fmt = "" + const char *fmt = "" "404 Not Found" "" "

Not Found

"