diff --git a/albumart.c b/albumart.c index d1d26bb..ea71be9 100644 --- a/albumart.c +++ b/albumart.c @@ -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); } }