diff mbox series

[2/6] core: Remove g_utf8_strlen use

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

Commit Message

Denis Kenzior Feb. 5, 2024, 9:31 p.m. UTC
Replace with l_utf8_strlen
---
 src/smsutil.c  | 2 +-
 src/stkagent.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/src/smsutil.c b/src/smsutil.c
index d07960190103..f46507f00e1c 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -549,7 +549,7 @@  gboolean sms_encode_address_field(const struct sms_address *in, gboolean sc,
 		unsigned char *r;
 
 		/* TP-OA's 10 octets transport 11 8-bit chars */
-		if (g_utf8_strlen(addr, strlen(addr)) > 11)
+		if (l_utf8_strlen(addr) > 11)
 			return FALSE;
 
 		gsm = convert_utf8_to_gsm(in->address, len, NULL, &written, 0);
diff --git a/src/stkagent.c b/src/stkagent.c
index 6c1f6d57093f..8748ec63022c 100644
--- a/src/stkagent.c
+++ b/src/stkagent.c
@@ -838,7 +838,7 @@  static void get_input_cb(DBusPendingCall *call, void *data)
 		goto error;
 	}
 
-	len = g_utf8_strlen(string, -1);
+	len = l_utf8_strlen(string);
 
 	if (len < agent->min_length || len > agent->max_length) {
 		ofono_error("Length not acceptable");