diff --git a/src/common/compat.c b/src/common/compat.c index 7f0823bbe1..d2abc2af50 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -143,14 +143,16 @@ tor_vsnprintf(char *str, size_t size, const char *format, va_list args) * Requires that nlen be greater than zero. */ const void * -tor_memmem(const void *haystack, size_t hlen, const void *needle, size_t nlen) +tor_memmem(const void *_haystack, size_t hlen, const void *_needle, size_t nlen) { #if defined(HAVE_MEMMEM) && (!defined(__GNUC__) || __GNUC__ >= 2) tor_assert(nlen); return memmem(haystack, hlen, needle, nlen); #else /* This isn't as fast as the GLIBC implementation, but it doesn't need to be. */ - const void *p, *end; + const char *p, *end; + const char *haystack = (const char*)_haystack; + const char *needle = (const char*)_needle; char first; tor_assert(nlen); diff --git a/src/or/control.c b/src/or/control.c index 582f6e001e..752a6d4dec 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -270,7 +270,7 @@ write_escaped_data(const char *data, size_t len, int translate_newlines, const char *end; int i; int start_of_line; - for (i=0; i #endif -/* These signals are defined to help control_signal_act work. - * XXXX Move into or.h or compat.h - */ -#ifndef SIGHUP -#define SIGHUP 1 -#endif -#ifndef SIGINT -#define SIGINT 2 -#endif -#ifndef SIGUSR1 -#define SIGUSR1 10 -#endif -#ifndef SIGUSR2 -#define SIGUSR2 12 -#endif -#ifndef SIGTERM -#define SIGTERM 15 -#endif - /********* PROTOTYPES **********/ static void dumpmemusage(int severity); diff --git a/src/or/or.h b/src/or/or.h index 68d974e5f6..59ec3c9ed0 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -139,6 +139,25 @@ #include "../common/util.h" #include "../common/torgzip.h" +/* These signals are defined to help control_signal_act work. + * XXXX Move into compat.h ? + */ +#ifndef SIGHUP +#define SIGHUP 1 +#endif +#ifndef SIGINT +#define SIGINT 2 +#endif +#ifndef SIGUSR1 +#define SIGUSR1 10 +#endif +#ifndef SIGUSR2 +#define SIGUSR2 12 +#endif +#ifndef SIGTERM +#define SIGTERM 15 +#endif + #if (SIZEOF_CELL_T != 0) /* On Irix, stdlib.h defines a cell_t type, so we need to make sure * that our stuff always calls cell_t something different. */