summaryrefslogtreecommitdiffstats
path: root/playtreeparser.c
diff options
context:
space:
mode:
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