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:
parent
331d484555
commit
e2cebb68e1
16
albumart.c
16
albumart.c
@ -267,7 +267,7 @@ check_for_album_file(const char *path)
|
|||||||
struct album_art_name_s *album_art_name;
|
struct album_art_name_s *album_art_name;
|
||||||
image_s *imsrc = NULL;
|
image_s *imsrc = NULL;
|
||||||
int width=0, height=0;
|
int width=0, height=0;
|
||||||
char *art_file;
|
char *art_file, *p;
|
||||||
const char *dir;
|
const char *dir;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int ret;
|
int ret;
|
||||||
@ -289,19 +289,19 @@ check_for_album_file(const char *path)
|
|||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
{
|
{
|
||||||
strncpyt(file, path, sizeof(file));
|
strncpyt(file, path, sizeof(file));
|
||||||
art_file = strrchr(file, '.');
|
p = strrchr(file, '.');
|
||||||
if( art_file )
|
if( p )
|
||||||
{
|
{
|
||||||
strcpy(art_file, ".jpg");
|
strcpy(p, ".jpg");
|
||||||
ret = access(file, R_OK);
|
ret = access(file, R_OK);
|
||||||
}
|
}
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
{
|
{
|
||||||
art_file = strrchr(file, '/');
|
p = strrchr(file, '/');
|
||||||
if( art_file )
|
if( p )
|
||||||
{
|
{
|
||||||
memmove(art_file+2, art_file+1, file+MAXPATHLEN-art_file-2);
|
memmove(p+2, p+1, file+MAXPATHLEN-p-2);
|
||||||
art_file[1] = '.';
|
p[1] = '.';
|
||||||
ret = access(file, R_OK);
|
ret = access(file, R_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user