aboutsummaryrefslogtreecommitdiffstats
path: root/src/fm.c
diff options
context:
space:
mode:
authorverdant <im@verdant.ee>2026-08-06 14:55:55 +0800
committerverdant <im@verdant.ee>2026-08-06 14:55:55 +0800
commit026f1d10feb2eb793781b99aa0550106063a3b7a (patch)
treea89b7fb5285dc7dc4b7b71aba63386af8a57f4c5 /src/fm.c
parent908a2abc1f8108a3cc81f0bc4151adf79472eb49 (diff)
downloadsf-026f1d10feb2eb793781b99aa0550106063a3b7a.tar.gz
sf-026f1d10feb2eb793781b99aa0550106063a3b7a.zip
fm: add argument checking and remove raw function call
Diffstat (limited to 'src/fm.c')
-rw-r--r--src/fm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fm.c b/src/fm.c
index 06a980c..a7e1722 100644
--- a/src/fm.c
+++ b/src/fm.c
@@ -107,8 +107,10 @@ fm_getcwd(fm_info *info)
static void
fm_file_items_realloc(file_list *l)
{
+ if (!l)
+ return;
+
l->cap *= 2;
- l->items = realloc(l->items, sizeof(file_item) * l->cap);
l->items = xrealloc(l->items, sizeof(file_item) * l->cap);
}