From: Denis Kenzior <denkenz@gmail.com>
To: ofono@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH 5/6] simutil: Drop use of g_utf8_validate_len
Date: Mon, 5 Feb 2024 15:31:26 -0600 [thread overview]
Message-ID: <20240205213150.1001245-5-denkenz@gmail.com> (raw)
In-Reply-To: <20240205213150.1001245-1-denkenz@gmail.com>
Use l_utf8_validate instead.
---
src/simutil.c | 4 ++--
src/simutil.h | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
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);
--
2.43.0
next prev parent reply other threads:[~2024-02-05 21:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 21:31 [PATCH 1/6] stkagent: Use l_utf8_get_codepoint Denis Kenzior
2024-02-05 21:31 ` [PATCH 2/6] core: Remove g_utf8_strlen use Denis Kenzior
2024-02-05 21:31 ` [PATCH 3/6] unit: " Denis Kenzior
2024-02-05 21:31 ` [PATCH 4/6] qmimodem: Drop use of g_utf8_validate Denis Kenzior
2024-02-05 21:31 ` Denis Kenzior [this message]
2024-02-05 21:31 ` [PATCH 6/6] unit: Update to the new API Denis Kenzior
2024-02-06 16:30 ` [PATCH 1/6] stkagent: Use l_utf8_get_codepoint patchwork-bot+ofono
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240205213150.1001245-5-denkenz@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox