summaryrefslogtreecommitdiff
path: root/apps/onplay.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/onplay.c')
-rw-r--r--apps/onplay.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index 621bf82607..9f38b32fb4 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -532,7 +532,7 @@ static bool delete_handler(bool is_dir)
532 { 532 {
533 char pathname[MAX_PATH]; /* space to go deep */ 533 char pathname[MAX_PATH]; /* space to go deep */
534 cpu_boost(true); 534 cpu_boost(true);
535 strncpy(pathname, file_to_delete, sizeof pathname); 535 strlcpy(pathname, file_to_delete, sizeof(pathname));
536 res = remove_dir(pathname, sizeof(pathname)); 536 res = remove_dir(pathname, sizeof(pathname));
537 cpu_boost(false); 537 cpu_boost(false);
538 } 538 }
@@ -578,7 +578,7 @@ static bool rename_file(void)
578 char newname[MAX_PATH]; 578 char newname[MAX_PATH];
579 char* ptr = strrchr(selected_file, '/') + 1; 579 char* ptr = strrchr(selected_file, '/') + 1;
580 int pathlen = (ptr - selected_file); 580 int pathlen = (ptr - selected_file);
581 strncpy(newname, selected_file, sizeof newname); 581 strlcpy(newname, selected_file, sizeof(newname));
582 if (!kbd_input(newname + pathlen, (sizeof newname)-pathlen)) { 582 if (!kbd_input(newname + pathlen, (sizeof newname)-pathlen)) {
583 if (!strlen(newname + pathlen) || 583 if (!strlen(newname + pathlen) ||
584 (rename(selected_file, newname) < 0)) { 584 (rename(selected_file, newname) < 0)) {
@@ -638,7 +638,7 @@ static bool properties(void)
638static bool clipboard_clip(bool copy) 638static bool clipboard_clip(bool copy)
639{ 639{
640 clipboard_selection[0] = 0; 640 clipboard_selection[0] = 0;
641 strncpy(clipboard_selection, selected_file, sizeof(clipboard_selection)); 641 strlcpy(clipboard_selection, selected_file, sizeof(clipboard_selection));
642 clipboard_selection_attr = selected_file_attr; 642 clipboard_selection_attr = selected_file_attr;
643 clipboard_is_copy = copy; 643 clipboard_is_copy = copy;
644 644
@@ -895,15 +895,15 @@ static bool clipboard_paste(void)
895 } 895 }
896 else 896 else
897 { 897 {
898 strncpy(srcpath, clipboard_selection, sizeof(srcpath)); 898 strlcpy(srcpath, clipboard_selection, sizeof(srcpath));
899 strncpy(targetpath, target, sizeof(targetpath)); 899 strlcpy(targetpath, target, sizeof(targetpath));
900 900
901 success = clipboard_pastedirectory(srcpath, sizeof(srcpath), 901 success = clipboard_pastedirectory(srcpath, sizeof(srcpath),
902 target, sizeof(targetpath), clipboard_is_copy); 902 target, sizeof(targetpath), clipboard_is_copy);
903 903
904 if (success && !clipboard_is_copy) 904 if (success && !clipboard_is_copy)
905 { 905 {
906 strncpy(srcpath, clipboard_selection, sizeof(srcpath)); 906 strlcpy(srcpath, clipboard_selection, sizeof(srcpath));
907 remove_dir(srcpath, sizeof(srcpath)); 907 remove_dir(srcpath, sizeof(srcpath));
908 } 908 }
909 } 909 }
@@ -1026,7 +1026,7 @@ MENUITEM_FUNCTION(set_backdrop_item, 0, ID2P(LANG_SET_AS_BACKDROP),
1026#ifdef HAVE_RECORDING 1026#ifdef HAVE_RECORDING
1027static bool set_recdir(void) 1027static bool set_recdir(void)
1028{ 1028{
1029 strncpy(global_settings.rec_directory, 1029 strlcpy(global_settings.rec_directory,
1030 selected_file, MAX_FILENAME+1); 1030 selected_file, MAX_FILENAME+1);
1031 settings_save(); 1031 settings_save();
1032 return false; 1032 return false;