sbase-box: Reduce bss size using dynamic memory

There are several big buffers that consume a lot of bss
memory even when the applications are not used. This patch
removes several of them using dynamic memory instead.
This commit is contained in:
Roberto E. Vargas Caballero 2025-12-08 18:13:14 +01:00
parent 13db2e48d4
commit 7ff51bffd1
2 changed files with 5 additions and 2 deletions

4
ls.c
View File

@ -33,7 +33,7 @@ struct entry {
static struct {
dev_t dev;
ino_t ino;
} tree[PATH_MAX];
} *tree;
static int ret = 0;
static int Aflag = 0;
@ -371,6 +371,8 @@ main(int argc, char *argv[])
struct entry ent, *dents, *fents;
size_t i, ds, fs;
tree = ereallocarray(NULL, PATH_MAX, sizeof(*tree));
ARGBEGIN {
case '1':
/* force output to 1 entry per line */

View File

@ -29,7 +29,7 @@ static size_t curprocs, maxprocs = 1;
static int nerrors;
static int nulflag, nflag, pflag, rflag, tflag, xflag, Iflag;
static char *argb;
static char *cmd[NARGS];
static char **cmd;
static char *eofstr;
static int
@ -259,6 +259,7 @@ main(int argc, char *argv[])
argmaxsz = _POSIX_ARG_MAX;
/* Leave some room for environment variables */
argmaxsz -= 4096;
cmd = emalloc(NARGS * sizeof(*cmd));
ARGBEGIN {
case '0':