diff options
author | Max Kellermann <max@duempel.org> | 2009-01-04 21:24:22 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-04 21:24:22 +0100 |
commit | 3516d8fc1daf88716a3648878c961b2cee549d7e (patch) | |
tree | 3fe1352a88ee9ff5bc1ac638d2fbdb91b01dacc8 /src | |
parent | 200ef56d4dfbcead7e20d036352f20cd67612772 (diff) | |
download | mpd-3516d8fc1daf88716a3648878c961b2cee549d7e.tar.gz mpd-3516d8fc1daf88716a3648878c961b2cee549d7e.tar.xz mpd-3516d8fc1daf88716a3648878c961b2cee549d7e.zip |
tag: allocate space for null terminator in clear_non_printable()
Use g_strndup() instead of g_memdup().
Diffstat (limited to 'src')
-rw-r--r-- | src/tag.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -483,9 +483,7 @@ clear_non_printable(const char *p, size_t length) if (first == NULL) return NULL; - /* duplicate and null-terminate the string */ - dest = g_memdup(p, length); - dest[length] = 0; + dest = g_strndup(p, length); for (size_t i = first - p; i < length; ++i) if (char_is_non_printable(dest[i])) |