diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-31 07:42:40 +0100 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-31 07:42:40 +0100 |
| commit | 2f7623ff06ca9b1b77c65ab7ba3acfe7ccf371d8 (patch) | |
| tree | 685c63a6302898acb6b5b1407ec28e1662985bcb /util/libreboot-utils/lib/state.c | |
| parent | fb5f1b4ed150087ee22c4ce9864fa9cd04178a9f (diff) | |
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>
Diffstat (limited to 'util/libreboot-utils/lib/state.c')
| -rw-r--r-- | util/libreboot-utils/lib/state.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/util/libreboot-utils/lib/state.c b/util/libreboot-utils/lib/state.c index f0be5656..f32d4078 100644 --- a/util/libreboot-utils/lib/state.c +++ b/util/libreboot-utils/lib/state.c @@ -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); |
