diff --git a/mongoose.c b/mongoose.c index 7fc8dd7d..6561729a 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1469,9 +1469,9 @@ void mg_mgr_poll(struct mg_mgr *mgr, int ms) { #ifdef MG_ENABLE_LINES #line 1 "src/md5.c" #endif - #include + #if MG_ENABLE_MD5 #if !defined(BYTE_ORDER) && defined(__BYTE_ORDER) #define BYTE_ORDER __BYTE_ORDER @@ -1521,7 +1521,7 @@ void mg_md5_init(mg_md5_ctx *ctx) { } static void mg_md5_transform(uint32_t buf[4], uint32_t const in[16]) { - register uint32_t a, b, c, d; + uint32_t a, b, c, d; a = buf[0]; b = buf[1]; diff --git a/mongoose.h b/mongoose.h index 226d6e6d..75a9a5cf 100644 --- a/mongoose.h +++ b/mongoose.h @@ -255,6 +255,7 @@ enum { false = 0, true = 1 }; #include +// Protect from calls like std::snprintf in app code // See https://github.com/cesanta/mongoose/issues/1047 #ifndef __cplusplus #define snprintf _snprintf diff --git a/src/md5.c b/src/md5.c index a1000917..4b1e3d17 100644 --- a/src/md5.c +++ b/src/md5.c @@ -1,5 +1,5 @@ -#include "md5.h" #include +#include "md5.h" #if MG_ENABLE_MD5 #if !defined(BYTE_ORDER) && defined(__BYTE_ORDER) @@ -50,7 +50,7 @@ void mg_md5_init(mg_md5_ctx *ctx) { } static void mg_md5_transform(uint32_t buf[4], uint32_t const in[16]) { - register uint32_t a, b, c, d; + uint32_t a, b, c, d; a = buf[0]; b = buf[1];