]> granicus.if.org Git - libevent/commitdiff
r16507@catbus: nickm | 2007-11-07 01:34:55 -0500
authorNick Mathewson <nickm@torproject.org>
Wed, 7 Nov 2007 07:33:21 +0000 (07:33 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 7 Nov 2007 07:33:21 +0000 (07:33 +0000)
 Never assign a string constant to a non-const char *.

svn:r495

event.h
http.c

diff --git a/event.h b/event.h
index 6d9c3db9dd75a61e839450ba031701a7c9bea66b..6af47206e0a301609da11e80b0d68263c3c1941f 100644 (file)
--- 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 3e53a90cce3f2a2db5e8bca18a8e007842f7785d..d190f0c481a3b581337588de516887f5823a6588 100644 (file)
--- 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 = "<HTML><HEAD>\n"
+       const char *fmt = "<HTML><HEAD>\n"
            "<TITLE>%d %s</TITLE>\n"
            "</HEAD><BODY>\n"
            "<H1>Method Not Implemented</H1>\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 = "<html><head>"
+               const char *fmt = "<html><head>"
                    "<title>404 Not Found</title>"
                    "</head><body>"
                    "<h1>Not Found</h1>"