diff options
Diffstat (limited to 'apps/cuesheet.c')
-rw-r--r-- | apps/cuesheet.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c index aace64a8fc..fa1d93f334 100644 --- a/apps/cuesheet.c +++ b/apps/cuesheet.c | |||
@@ -84,7 +84,7 @@ bool look_for_cuesheet_file(const char *trackpath, char *found_cue_path) | |||
84 | return false; | 84 | return false; |
85 | } | 85 | } |
86 | 86 | ||
87 | strncpy(cuepath, trackpath, MAX_PATH); | 87 | strlcpy(cuepath, trackpath, MAX_PATH); |
88 | dot = strrchr(cuepath, '.'); | 88 | dot = strrchr(cuepath, '.'); |
89 | strcpy(dot, ".cue"); | 89 | strcpy(dot, ".cue"); |
90 | 90 | ||
@@ -103,7 +103,7 @@ bool look_for_cuesheet_file(const char *trackpath, char *found_cue_path) | |||
103 | } | 103 | } |
104 | 104 | ||
105 | if (found_cue_path) | 105 | if (found_cue_path) |
106 | strncpy(found_cue_path, cuepath, MAX_PATH); | 106 | strlcpy(found_cue_path, cuepath, MAX_PATH); |
107 | return true; | 107 | return true; |
108 | } | 108 | } |
109 | 109 | ||
@@ -205,8 +205,7 @@ bool parse_cuesheet(char *file, struct cuesheet *cue) | |||
205 | } | 205 | } |
206 | else | 206 | else |
207 | { | 207 | { |
208 | strncpy(dest, string, MAX_NAME*3); | 208 | strlcpy(dest, string, MAX_NAME*3 + 1); |
209 | dest[MAX_NAME*3] = '\0'; | ||
210 | } | 209 | } |
211 | } | 210 | } |
212 | } | 211 | } |
@@ -218,10 +217,10 @@ bool parse_cuesheet(char *file, struct cuesheet *cue) | |||
218 | for (i = 0; i < cue->track_count; i++) | 217 | for (i = 0; i < cue->track_count; i++) |
219 | { | 218 | { |
220 | if (*(cue->tracks[i].performer) == '\0') | 219 | if (*(cue->tracks[i].performer) == '\0') |
221 | strncpy(cue->tracks[i].performer, cue->performer, MAX_NAME*3); | 220 | strlcpy(cue->tracks[i].performer, cue->performer, MAX_NAME*3); |
222 | 221 | ||
223 | if (*(cue->tracks[i].songwriter) == '\0') | 222 | if (*(cue->tracks[i].songwriter) == '\0') |
224 | strncpy(cue->tracks[i].songwriter, cue->songwriter, MAX_NAME*3); | 223 | strlcpy(cue->tracks[i].songwriter, cue->songwriter, MAX_NAME*3); |
225 | } | 224 | } |
226 | 225 | ||
227 | return true; | 226 | return true; |
@@ -271,7 +270,7 @@ static char *list_get_name_cb(int selected_item, | |||
271 | struct cuesheet *cue = (struct cuesheet *)data; | 270 | struct cuesheet *cue = (struct cuesheet *)data; |
272 | 271 | ||
273 | if (selected_item & 1) | 272 | if (selected_item & 1) |
274 | strncpy(buffer, cue->tracks[selected_item/2].title, buffer_len); | 273 | strlcpy(buffer, cue->tracks[selected_item/2].title, buffer_len); |
275 | else | 274 | else |
276 | snprintf(buffer, buffer_len, "%02d. %s", selected_item/2+1, | 275 | snprintf(buffer, buffer_len, "%02d. %s", selected_item/2+1, |
277 | cue->tracks[selected_item/2].performer); | 276 | cue->tracks[selected_item/2].performer); |