mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 23:08:49 +02:00
libreboot-utils: unified max path lengths
just use PATH_MAX like a normal person with additional safety Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -22,12 +22,6 @@
|
||||
struct xstate *
|
||||
xstart(int argc, char *argv[])
|
||||
{
|
||||
#if defined(PATH_LEN) && \
|
||||
((PATH_LEN) >= 256)
|
||||
static size_t maxlen = PATH_LEN;
|
||||
#else
|
||||
static size_t maxlen = 4096;
|
||||
#endif
|
||||
static int first_run = 1;
|
||||
static char *dir = NULL;
|
||||
static char *base = NULL;
|
||||
@@ -119,7 +113,7 @@ xstart(int argc, char *argv[])
|
||||
err_exit(errno, "xstart: don't know CWD of %s",
|
||||
us.f.fname);
|
||||
|
||||
sdup(base, maxlen, &us.f.base);
|
||||
sdup(base, PATH_MAX, &us.f.base);
|
||||
|
||||
us.f.dirfd = fs_open(dir,
|
||||
O_RDONLY | O_DIRECTORY);
|
||||
@@ -133,7 +127,7 @@ xstart(int argc, char *argv[])
|
||||
&tmpdir, &tmpbase_local, 0) < 0)
|
||||
err_exit(errno, "tmp basename");
|
||||
|
||||
sdup(tmpbase_local, maxlen, &us.f.tmpbase);
|
||||
sdup(tmpbase_local, PATH_MAX, &us.f.tmpbase);
|
||||
|
||||
free_and_set_null(&tmpdir);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user