r16507@catbus: nickm | 2007-11-07 01:34:55 -0500

Never assign a string constant to a non-const char *.


svn:r495
This commit is contained in:
Nick Mathewson 2007-11-07 07:33:21 +00:00
parent a3f122d667
commit 7feba57010
2 changed files with 5 additions and 4 deletions

View File

@ -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 *);

7
http.c
View File

@ -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>"