aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-29 09:38:58 +0200
committerMax Kellermann <max@duempel.org>2008-08-29 09:38:58 +0200
commit43c389b961c609f9c705cfe14ed429082ac9115a (patch)
tree61e93ef93115a5f96c5981cae1fd7a36e789d9f7 /src/tag.c
parent92b757674ebcf5cf90e8adb66e7583edf1bc604e (diff)
downloadmpd-43c389b961c609f9c705cfe14ed429082ac9115a.tar.gz
mpd-43c389b961c609f9c705cfe14ed429082ac9115a.tar.xz
mpd-43c389b961c609f9c705cfe14ed429082ac9115a.zip
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.
Diffstat (limited to 'src/tag.c')
-rw-r--r--src/tag.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tag.c b/src/tag.c
index a52391b42..1d22b46d1 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);