aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2025-07-07 17:31:55 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2025-07-07 17:31:55 -0400
commitdec6933405df0155a60c376e5345f71250b649b0 (patch)
tree3ebc78e7a948c30bcda550fd2b5242980bdc714a
parent641c5d9cff3369b4cf0000a60180b47f3cefb0fa (diff)
downloadstasis-dec6933405df0155a60c376e5345f71250b649b0.tar.gz
Convert sprintf to snprintf
-rw-r--r--src/lib/core/environment.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/core/environment.c b/src/lib/core/environment.c
index f5e8566..407c76c 100644
--- a/src/lib/core/environment.c
+++ b/src/lib/core/environment.c
@@ -106,14 +106,13 @@ void runtime_export(RuntimeEnv *env, char **keys) {
if (keys != NULL) {
for (size_t j = 0; keys[j] != NULL; j++) {
if (strcmp(keys[j], key) == 0) {
- //sprintf(output, "%s=\"%s\"\n%s %s", key, value ? value : "", export_command, key);
- sprintf(output, "%s %s=\"%s\"", export_command, key, value ? value : "");
+ snprintf(output, sizeof(output), "%s %s=\"%s\"", export_command, key, value ? value : "");
puts(output);
}
}
}
else {
- sprintf(output, "%s %s=\"%s\"", export_command, key, value ? value : "");
+ snprintf(output, sizeof(output), "%s %s=\"%s\"", export_command, key, value ? value : "");
puts(output);
}
guard_free(value);