diff mbox series

[12/21] mongoose: Replace deprecated static mg_ncasecmp() with strncmp()

Message ID 20240615191941.40301-13-Michael.Glembotzki@iris-sensing.com
State Changes Requested
Headers show
Series Update Mongoose to 7.14 | expand

Commit Message

Michael Glembotzki June 15, 2024, 7:11 p.m. UTC
mongoose rev-id: b46bee0540c83c780ae9622ef18b9cc8a7b3ebab

Signed-off-by: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com>
---
 mongoose/mongoose_interface.c | 2 +-
 mongoose/mongoose_multipart.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/mongoose/mongoose_interface.c b/mongoose/mongoose_interface.c
index 21b2bf9c..5a4e98fd 100644
--- a/mongoose/mongoose_interface.c
+++ b/mongoose/mongoose_interface.c
@@ -236,7 +236,7 @@  static int mg_check_digest_auth(struct mg_str method, struct mg_str uri,
 			mg_vcmp(&auth_domain, f_domain) == 0) {
 			/* Username and domain matched, check the password */
 			mg_mkmd5resp(method, uri, mg_str_s(f_ha1), nonce, nc, cnonce, qop, exp_resp);
-			return mg_ncasecmp(response.buf, exp_resp, strlen(exp_resp)) == 0;
+			return strncmp(response.buf, exp_resp, strlen(exp_resp)) == 0;
 		}
 	}
 
diff --git a/mongoose/mongoose_multipart.c b/mongoose/mongoose_multipart.c
index 6db59aff..b60de2e1 100644
--- a/mongoose/mongoose_multipart.c
+++ b/mongoose/mongoose_multipart.c
@@ -203,7 +203,7 @@  static int mg_http_multipart_process_boundary(struct mg_connection *c) {
 		   (line_len = mg_get_line_len(block_begin, data_size)) != 0) {
 		mp_stream->len -= (line_len + 2);
 		if (line_len > sizeof(CONTENT_DISPOSITION) &&
-			mg_ncasecmp(block_begin, CONTENT_DISPOSITION,
+			strncmp(block_begin, CONTENT_DISPOSITION,
 						sizeof(CONTENT_DISPOSITION) - 1) == 0) {
 			struct mg_str header;
 
@@ -219,7 +219,7 @@  static int mg_http_multipart_process_boundary(struct mg_connection *c) {
 			continue;
 		}
 
-		if (line_len == 2 && mg_ncasecmp(block_begin, "\r\n", 2) == 0) {
+		if (line_len == 2 && strncmp(block_begin, "\r\n", 2) == 0) {
 			if (mp_stream->processing_part != 0) {
 				mg_http_multipart_call_handler(c, MG_EV_HTTP_PART_END, NULL, 0);
 			}