summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--playlist.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/playlist.c b/playlist.c
index 424a5b49..c09f7284 100644
--- a/playlist.c
+++ b/playlist.c
@@ -840,10 +840,15 @@ pl_get_qvalue_from_cue (const uint8_t *p, int sz, char *out) {
*out = 0;
}
else {
- while (*p && *p > 0x20) {
+ while (*p && *p >= 0x20) {
sz--;
*out++ = *p++;
}
+ out--;
+ while (out > str && *out == 0x20) {
+ out--;
+ }
+ out++;
*out = 0;
}
const char *charset = junk_detect_charset (str);