mirror of https://github.com/mpv-player/mpv
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:
parent
6e75421754
commit
a204add899
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue