albumart: use a separate variable for temporary pointer storage

Re-using the same one confuses some static code analyzers, and
is a bit less readable.
This commit is contained in:
Justin Maggard 2014-04-18 15:36:38 -07:00
parent 331d484555
commit e2cebb68e1

View File

@ -267,7 +267,7 @@ check_for_album_file(const char *path)
struct album_art_name_s *album_art_name;
image_s *imsrc = NULL;
int width=0, height=0;
char *art_file;
char *art_file, *p;
const char *dir;
struct stat st;
int ret;
@ -289,19 +289,19 @@ check_for_album_file(const char *path)
if( ret != 0 )
{
strncpyt(file, path, sizeof(file));
art_file = strrchr(file, '.');
if( art_file )
p = strrchr(file, '.');
if( p )
{
strcpy(art_file, ".jpg");
strcpy(p, ".jpg");
ret = access(file, R_OK);
}
if( ret != 0 )
{
art_file = strrchr(file, '/');
if( art_file )
p = strrchr(file, '/');
if( p )
{
memmove(art_file+2, art_file+1, file+MAXPATHLEN-art_file-2);
art_file[1] = '.';
memmove(p+2, p+1, file+MAXPATHLEN-p-2);
p[1] = '.';
ret = access(file, R_OK);
}
}