1
0
Fork 0
forked from len0rd/rockbox

Dircache: Refine name allocation and error handling.

* 8 bits is enough to allow 260 character base names when five
bytes is the minimum indirect storage size (0..255->5..260).

* Don't truncate anything that's too long as that can lead to
bad behavior, simply don't include the offending entry in the
parent.

* Set the .tinyname flag to 1 by default to indicate that
the entry's name doesn't need freeing. Clear it only when
allocating indirect storage.

* Rename some things to help catch all instances

Change-Id: Iff747b624acbb8e03ed26c24afdf0fc715fd9d99
This commit is contained in:
Michael Sevakis 2017-03-12 20:59:44 -04:00
parent e3081b35cd
commit 70c929179b
3 changed files with 49 additions and 35 deletions

View file

@ -56,7 +56,7 @@
root + 'Music' + 'Artist' + 'Album' + 'Disc N' + filename */
#define STATIC_PATHCOMP_NUM 6
#define MAX_NAME 255
#define MAX_COMPNAME 260
/* unsigned value that will also hold the off_t range we need without
overflow */