diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-02 13:44:10 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-02 18:55:46 -0400 |
commit | 977399bb759aacd2a18ba76df78078ee4cee6e67 (patch) | |
tree | e1436edde5df9f092ee6c43f48b02c76391c652d /src/environment.c | |
parent | cfdf0e333d240526436aff5f886a1da6a0959bce (diff) | |
download | stasis-977399bb759aacd2a18ba76df78078ee4cee6e67.tar.gz |
Changes to strlist_*() functions:
Functions that modify the input StrList have been refactored to use `struct StrList **` instead of `struct StrList *`.
* Fixes realloc error handling
Diffstat (limited to 'src/environment.c')
-rw-r--r-- | src/environment.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/environment.c b/src/environment.c index 525e1da..824b447 100644 --- a/src/environment.c +++ b/src/environment.c @@ -149,7 +149,7 @@ RuntimeEnv *runtime_copy(char **env) { rt = strlist_init(); for (size_t i = 0; i < env_count; i++) { - strlist_append(rt, env[i]); + strlist_append(&rt, env[i]); } return rt; } @@ -411,9 +411,9 @@ void runtime_set(RuntimeEnv *env, const char *_key, char *_value) { char *now = join((char *[]) {key, value, NULL}, "="); if (key_offset < 0) { - strlist_append(env, now); + strlist_append(&env, now); } else { - strlist_set(env, key_offset, now); + strlist_set(&env, key_offset, now); } guard_free(now); guard_free(key); @@ -439,5 +439,5 @@ void runtime_free(RuntimeEnv *env) { if (env == NULL) { return; } - strlist_free(env); + strlist_free(&env); } |