diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index ba197a04c22a54905f3eba51fd217662aa62c3e3..6cb7b46efddf71590f40d010936a701f18b80d46 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
}
}
+static void
+path_lyr_file(char *path, size_t size,
+ const char *artist, const char *title)
+{
+ snprintf(path, size, "%s/.lyrics/%s - %s.txt",
+ getenv("HOME"), artist, title);
+}
+
static bool
exists_lyr_file(const char *artist, const char *title)
{
char path[1024];
struct stat result;
- snprintf(path, 1024, "%s/.lyrics/%s - %s.txt",
- getenv("HOME"), artist, title);
+ path_lyr_file(path, 1024, artist, title);
return (stat(path, &result) == 0);
}
getenv("HOME"));
mkdir(path, S_IRWXU);
- snprintf(path, 1024, "%s/.lyrics/%s - %s.txt",
- getenv("HOME"), artist, title);
+ path_lyr_file(path, 1024, artist, title);
return fopen(path, "w");
}