FS#10392 - settings.c:set_file function should'nt modify filename argument
Opened by Jonas Häggqvist (rasher) - Sunday, 28 June 2009, 17:18 GMT
Last edited by Alexander Levin (fml2) - Monday, 29 June 2009, 14:26 GMT
This simple patch stops set_file from modifying the filename argument.
Line 1157 sets the last / to \0, to split the filename variable into dir and basename. However, the dir part is only used in the following statement: strncasecmp(ROCKBOX_DIR, filename ,strlen(ROCKBOX_DIR)
Here, the comparison will be either true or false even without splitting the filename variable into dir part and basename part. I suspect it was previously doing a "dumber" comparison, and someone changed it to use strncasecmp, and didn't see this issue.
This is needed to fix a bug in
View Dependency Graph
Monday, 29 June 2009, 14:26 GMT
Reason for closing: Accepted
Additional comments about closing: Committed in r21551.