diff mbox series

[5/6] simutil: Drop use of g_utf8_validate_len

Message ID 20240205213150.1001245-5-denkenz@gmail.com (mailing list archive)
State Accepted
Commit bce36de2f98ee257d9ec798b0f86d6c14f4bc790
Headers show
Series [1/6] stkagent: Use l_utf8_get_codepoint | expand

Commit Message

Denis Kenzior Feb. 5, 2024, 9:31 p.m. UTC
Use l_utf8_validate instead.
---
 src/simutil.c | 4 ++--
 src/simutil.h | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/src/simutil.c b/src/simutil.c
index 59d8d5dd9c2d..0354cafd087f 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -766,7 +766,7 @@  unsigned char *comprehension_tlv_builder_get_data(
 	return tlv + tag_size + len_size;
 }
 
-gboolean validate_utf8_tlv(const unsigned char *tlv)
+bool validate_utf8_tlv(const unsigned char *tlv)
 {
 	int len = tlv[1];
 
@@ -777,7 +777,7 @@  gboolean validate_utf8_tlv(const unsigned char *tlv)
 	if (tlv[len + 1] == '\0')
 		len -= 1;
 
-	return g_utf8_validate_len((const char *)tlv + 2, len, NULL);
+	return l_utf8_validate((const char *)tlv + 2, len, NULL);
 }
 
 static char *sim_network_name_parse(const unsigned char *buffer, int length,
diff --git a/src/simutil.h b/src/simutil.h
index f908bbb44d15..fd3967ffd336 100644
--- a/src/simutil.h
+++ b/src/simutil.h
@@ -19,6 +19,8 @@ 
  *
  */
 
+#include <stdbool.h>
+
 #define SIM_EFSPN_DC_HOME_PLMN_BIT 0x1
 #define SIM_EFSPN_DC_ROAMING_SPN_BIT 0x2
 
@@ -408,7 +410,7 @@  gboolean comprehension_tlv_builder_set_length(
 				unsigned int len);
 unsigned char *comprehension_tlv_builder_get_data(
 				struct comprehension_tlv_builder *builder);
-gboolean validate_utf8_tlv(const unsigned char *data);
+bool validate_utf8_tlv(const unsigned char *data);
 
 void ber_tlv_iter_init(struct ber_tlv_iter *iter, const unsigned char *pdu,
 			unsigned int len);