From 62e966161b2fae86eb3e7966b7b5d71d241c86bb Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 20 Sep 2006 10:21:18 +0000 Subject: Add necessary cast to last parameter of g_utf8_validate --- hcid/security.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hcid/security.c b/hcid/security.c index 1b14dfac..55d38dff 100644 --- a/hcid/security.c +++ b/hcid/security.c @@ -468,7 +468,9 @@ static inline void remote_name_information(int dev, bdaddr_t *sba, void *ptr) if (!evt->status) { char *end; memcpy(name, evt->name, 248); - if (!g_utf8_validate(name, -1, &end)) + /* It's ok to cast end between const and non-const since + * we know it points to inside of name which is non-const */ + if (!g_utf8_validate(name, -1, (const char **) &end)) *end = '\0'; write_device_name(sba, &dba, name); } -- cgit