diff options
author | William Wilgus <me.theuser@yahoo.com> | 2018-07-25 19:28:25 +0200 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2018-07-25 19:33:52 +0200 |
commit | 5e5ddce270ce8fb87baff7ce898173fe2ae2fb6b (patch) | |
tree | a45e6b40c3f1fc2ef59bd416d5f6d54eca026a6a /apps/tree.c | |
parent | 7bec71368b306657323d80585019bb7e2aa0888c (diff) | |
download | rockbox-5e5ddce270ce8fb87baff7ce898173fe2ae2fb6b.tar.gz rockbox-5e5ddce270ce8fb87baff7ce898173fe2ae2fb6b.zip |
Fix truncation warnings in tree.c, filetree.c
Change-Id: Ic5ae1e5f904a3da4bba07cdef7f4bb003dc091b2
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/tree.c b/apps/tree.c index e03a494a54..6b496919b0 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -608,6 +608,7 @@ static int dirbrowse(void) | |||
608 | { | 608 | { |
609 | int numentries=0; | 609 | int numentries=0; |
610 | char buf[MAX_PATH]; | 610 | char buf[MAX_PATH]; |
611 | int len; | ||
611 | int button; | 612 | int button; |
612 | #ifdef HAVE_LCD_BITMAP | 613 | #ifdef HAVE_LCD_BITMAP |
613 | int oldbutton; | 614 | int oldbutton; |
@@ -800,8 +801,13 @@ static int dirbrowse(void) | |||
800 | attr = entry->attr; | 801 | attr = entry->attr; |
801 | 802 | ||
802 | if (currdir[1]) /* Not in / */ | 803 | if (currdir[1]) /* Not in / */ |
803 | snprintf(buf, sizeof buf, "%s/%s", | 804 | { |
805 | len = snprintf(buf, sizeof buf, "%s/%s", | ||
804 | currdir, entry->name); | 806 | currdir, entry->name); |
807 | |||
808 | if ((unsigned) len > sizeof(buf)) | ||
809 | splash(HZ, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); | ||
810 | } | ||
805 | else /* In / */ | 811 | else /* In / */ |
806 | snprintf(buf, sizeof buf, "/%s", entry->name); | 812 | snprintf(buf, sizeof buf, "/%s", entry->name); |
807 | } | 813 | } |