From 07c4a01f9fa55b620c9bf87a4e64e45de22b7e5f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 29 Aug 2008 09:38:58 +0200 Subject: added "length" parameter to validUtf8String() At several places, we create temporary copies of non-null-terminated strings, just to use them in functions like validUtf8String(). We can save this temporary allocation and avoid heap fragmentation if we add a length parameter instead of expecting a null-terminated string. --- src/tag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tag.c') diff --git a/src/tag.c b/src/tag.c index 927f1b789..b93456641 100644 --- a/src/tag.c +++ b/src/tag.c @@ -352,7 +352,7 @@ static inline char *fix_utf8(char *str) { assert(str != NULL); - if (validUtf8String(str)) + if (validUtf8String(str, strlen(str))) return str; DEBUG("not valid utf8 in tag: %s\n",str); -- cgit v1.2.3