mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-15 07:15:03 -04:00
Build more cleanly with NetBSDs that dislike toupper(char)
To be fair, when char can be signed, if toupper doesn't take negative characters, toupper(char) is a very bad idea. So let's just use the nice safe EVUTIL_TOUPPER instead. (It explicitly only upcases ASCII, but we only use it for identifiers that we know to be ASCII anyway).
This commit is contained in:
parent
840a72fbd5
commit
42a8c71112
3
event.c
3
event.c
@ -67,6 +67,7 @@
|
||||
#include "iocp-internal.h"
|
||||
#include "changelist-internal.h"
|
||||
#include "ht-internal.h"
|
||||
#include "util-internal.h"
|
||||
|
||||
#ifdef _EVENT_HAVE_EVENT_PORTS
|
||||
extern const struct eventop evportops;
|
||||
@ -446,7 +447,7 @@ event_is_method_disabled(const char *name)
|
||||
|
||||
evutil_snprintf(environment, sizeof(environment), "EVENT_NO%s", name);
|
||||
for (i = 8; environment[i] != '\0'; ++i)
|
||||
environment[i] = toupper(environment[i]);
|
||||
environment[i] = EVUTIL_TOUPPER(environment[i]);
|
||||
/* Note that evutil_getenv() ignores the environment entirely if
|
||||
* we're setuid */
|
||||
return (evutil_getenv(environment) != NULL);
|
||||
|
@ -1875,7 +1875,7 @@ methodname_to_envvar(const char *mname, char *buf, size_t buflen)
|
||||
char *cp;
|
||||
evutil_snprintf(buf, buflen, "EVENT_NO%s", mname);
|
||||
for (cp = buf; *cp; ++cp) {
|
||||
*cp = toupper(*cp);
|
||||
*cp = EVUTIL_TOUPPER(*cp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user