bunkus: Another nice off-by-one :)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8908 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
mosu 2003-01-12 11:45:49 +00:00
parent 6e75421754
commit a204add899
1 changed files with 4 additions and 2 deletions

View File

@ -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