Don't underflow the buffer in format_track_path() if it consists of whitespaces
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29325 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
84fccff170
commit
15a5f9ca95
1 changed files with 4 additions and 3 deletions
|
@ -1666,12 +1666,13 @@ static int format_track_path(char *dest, char *src, int buf_length, int max,
|
|||
i++;
|
||||
|
||||
/* Now work back killing white space */
|
||||
while((src[i-1] == ' ') ||
|
||||
(src[i-1] == '\t'))
|
||||
while((i > 0) &&
|
||||
((src[i-1] == ' ') ||
|
||||
(src[i-1] == '\t')))
|
||||
i--;
|
||||
|
||||
src[i]=0;
|
||||
|
||||
|
||||
/* replace backslashes with forward slashes */
|
||||
for ( j=0; j<i; j++ )
|
||||
if ( src[j] == '\\' )
|
||||
|
|
Loading…
Reference in a new issue