summaryrefslogtreecommitdiffstats
path: root/playtreeparser.c
diff options
context:
space:
mode:
authormosu <mosu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-12 11:45:49 +0000
committermosu <mosu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-12 11:45:49 +0000
commita204add899aa36b554a034a9285376d12841e671 (patch)
tree8769cf4e449ab6361393c6e3637b003b62c43589 /playtreeparser.c
parent6e75421754d73c44aad78dc24dde665b8b269f9b (diff)
downloadmpv-a204add899aa36b554a034a9285376d12841e671.tar.bz2
mpv-a204add899aa36b554a034a9285376d12841e671.tar.xz
bunkus: Another nice off-by-one :)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8908 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'playtreeparser.c')
-rw-r--r--playtreeparser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/playtreeparser.c b/playtreeparser.c
index 44524f5a3f..47068e40ef 100644
--- a/playtreeparser.c
+++ b/playtreeparser.c
@@ -35,11 +35,13 @@ static void
strstrip(char* str) {
char* i;
+ if (str==NULL)
+ return;
for(i = str ; i[0] != '\0' && strchr(WHITES,i[0]) != NULL; i++)
/* NOTHING */;
if(i[0] != '\0') {
- memmove(str,i,strlen(i));
- for(i = str + strlen(str) ; strchr(WHITES,i[0]) != NULL; i--)
+ memmove(str,i,strlen(i) + 1);
+ for(i = str + strlen(str) - 1 ; strchr(WHITES,i[0]) != NULL; i--)
/* NOTHING */;
i[1] = '\0';
} else