Skip to content

Commit da21374

Browse files
committed
Fix some warnings
1 parent 3cee59a commit da21374

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

menu/menu_displaylist.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2772,19 +2772,17 @@ static int create_string_list_rdb_entry_int(
27722772
int actual_int, const char *path, file_list_t *list)
27732773
{
27742774
size_t _len;
2775-
char str[16];
27762775
char tmp[128];
2777-
char out_lbl[NAME_MAX_LENGTH];
2778-
str[0] = '\0';
2779-
snprintf(str, sizeof(str), "%d", actual_int);
2776+
char out_lbl[NAME_MAX_LENGTH*2];
27802777
_len = strlcpy(out_lbl, label, sizeof(out_lbl));
2781-
_len += strlcpy(out_lbl + _len, "|", sizeof(out_lbl) - _len);
2782-
_len += strlcpy(out_lbl + _len, str, sizeof(out_lbl) - _len);
2783-
_len += strlcpy(out_lbl + _len, "|", sizeof(out_lbl) - _len);
2778+
out_lbl[_len++] = '|';
2779+
_len += snprintf(out_lbl + _len, sizeof(out_lbl) - _len, "%d", actual_int);
2780+
out_lbl[_len++] = '|';
27842781
strlcpy(out_lbl + _len, path, sizeof(out_lbl) - _len);
2785-
_len = strlcpy(tmp, desc, sizeof(tmp));
2786-
_len += strlcpy(tmp + _len, ": ", sizeof(tmp) - _len);
2787-
strlcpy(tmp + _len, str, sizeof(tmp) - _len);
2782+
_len = strlcpy(tmp, desc, sizeof(tmp));
2783+
tmp[_len++] = ':';
2784+
tmp[_len++] = ' ';
2785+
_len += snprintf(tmp + _len, sizeof(tmp) - _len, "%d", actual_int);
27882786
menu_entries_append(list, tmp, out_lbl,
27892787
enum_idx,
27902788
0, 0, 0, NULL);

menu/menu_explore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ static void explore_load_view(explore_state_t *state, const char* path)
13101310
unsigned menu_displaylist_explore(file_list_t *list, settings_t *settings)
13111311
{
13121312
unsigned i;
1313-
char tmp[512];
1313+
char tmp[1024];
13141314
struct explore_state *state = explore_state;
13151315
struct menu_state *menu_st = menu_state_get_ptr();
13161316
menu_handle_t *menu = menu_st->driver_data;

0 commit comments

Comments
 (0)