diff options
Diffstat (limited to 'event_tagging.c')
-rw-r--r-- | event_tagging.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/event_tagging.c b/event_tagging.c index 6459dfa..eea4bfc 100644 --- a/event_tagging.c +++ b/event_tagging.c @@ -26,27 +26,25 @@ */ #include "event2/event-config.h" -#include "evconfig-private.h" -#ifdef EVENT__HAVE_SYS_TYPES_H +#ifdef _EVENT_HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#ifdef EVENT__HAVE_SYS_PARAM_H +#ifdef _EVENT_HAVE_SYS_PARAM_H #include <sys/param.h> #endif -#ifdef _WIN32 +#ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <windows.h> #undef WIN32_LEAN_AND_MEAN -#endif - -#ifdef EVENT__HAVE_SYS_IOCTL_H +#else #include <sys/ioctl.h> #endif + #include <sys/queue.h> -#ifdef EVENT__HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include <sys/time.h> #endif @@ -54,10 +52,10 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#ifndef _WIN32 +#ifndef WIN32 #include <syslog.h> #endif -#ifdef EVENT__HAVE_UNISTD_H +#ifdef _EVENT_HAVE_UNISTD_H #include <unistd.h> #endif #include <limits.h> @@ -213,14 +211,7 @@ decode_tag_internal(ev_uint32_t *ptag, struct evbuffer *evbuf, int dodrain) while (count++ < len) { ev_uint8_t lower = *data++; - if (shift >= 28) { - /* Make sure it fits into 32 bits */ - if (shift > 28) - return (-1); - if ((lower & 0x7f) > 15) - return (-1); - } - number |= (lower & (unsigned)0x7f) << shift; + number |= (lower & 0x7f) << shift; shift += 7; if (!(lower & 0x80)) { |