]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
env-util: use our own sc_arg_max() helper at more places
authorLennart Poettering <lennart@amutable.com>
Wed, 1 Jul 2026 09:03:19 +0000 (11:03 +0200)
committerLennart Poettering <lennart@amutable.com>
Wed, 1 Jul 2026 14:14:19 +0000 (16:14 +0200)
src/basic/env-util.c

index 934428e7f520d3b575be6168290b1a0338a13c80..4f677565e935d497b16577d55f47251b9075ca79 100644 (file)
@@ -555,7 +555,7 @@ char* strv_env_get_n(char * const *l, const char *name, size_t k, ReplaceEnvFlag
                 const char *t;
 
                 /* Safety check that the name is not overly long, before we do a stack allocation */
-                if (k > (size_t) sysconf(_SC_ARG_MAX) - 2)
+                if (k > sc_arg_max() - 2)
                         return NULL;
 
                 t = strndupa_safe(name, k);