Skip to content

Commit

Permalink
albumart: use a separate variable for temporary pointer storage
Browse files Browse the repository at this point in the history
Re-using the same one confuses some static code analyzers, and
is a bit less readable.
  • Loading branch information
jmaggard10 committed Apr 18, 2014
1 parent 331d484 commit e2cebb6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions albumart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
}
Expand Down

0 comments on commit e2cebb6

Please sign in to comment.