File 3652-erts-esock-Fixed-type-warnings-with-casting.patch of Package erlang

From 9da7af5ddb827143bd053b9f4647524145b9bf5b Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Wed, 11 Oct 2023 18:15:03 +0200
Subject: [PATCH 2/2] [erts|esock] Fixed type warnings with casting

---
 erts/emulator/nifs/common/prim_socket_nif.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/erts/emulator/nifs/common/prim_socket_nif.c b/erts/emulator/nifs/common/prim_socket_nif.c
index d27e7b96d6..6fac954ad0 100644
--- a/erts/emulator/nifs/common/prim_socket_nif.c
+++ b/erts/emulator/nifs/common/prim_socket_nif.c
@@ -8137,21 +8137,27 @@ ERL_NIF_TERM esock_setopt_str_opt(ErlNifEnv*       env,
     ESOCK_ASSERT( val != NULL );
 
     if ((optLen = GET_STR(env, eVal, val, max)) > 0) {
+
         optLen--;
 
         result =
             esock_setopt_level_opt(env, descP, level, opt,
                                    val, optLen);
+
     } else if (enif_inspect_binary(env, eVal, &bin)) {
-        optLen = esock_strnlen(bin.data, max - 1);
+
+        optLen = esock_strnlen((char*) bin.data, max - 1);
         sys_memcpy(val, bin.data, optLen);
         val[optLen] = '\0';
 
         result =
             esock_setopt_level_opt(env, descP, level, opt,
                                    val, optLen);
+
     } else {
+
         result = esock_make_invalid(env, atom_value);
+
     }
 
     FREE(val);
-- 
2.35.3

openSUSE Build Service is sponsored by