diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-02 13:10:47 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-02 13:10:47 -0400 |
| commit | 7e7806980c125418760534b3e95ff590ca02cd85 (patch) | |
| tree | feeb050032cc7ee63757bf19d94e32f267c05733 /src/lib | |
| parent | d9f47950164aef02163a7feb956f03d860699d68 (diff) | |
| download | stasis-7e7806980c125418760534b3e95ff590ca02cd85.tar.gz | |
Replace string functions
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/core/template.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/core/template.c b/src/lib/core/template.c index 8396b1e..fa29104 100644 --- a/src/lib/core/template.c +++ b/src/lib/core/template.c @@ -235,8 +235,7 @@ char *tpl_render(char *str) { value = strdup(env_val ? env_val : ""); } else if (do_func) { // {{ func:NAME(a, ...) }} char func_name_temp[STASIS_NAME_MAX] = {0}; - strncpy(func_name_temp, type_stop + 1, sizeof(func_name_temp) - 1); - func_name_temp[sizeof(func_name_temp) - 1] = '\0'; + safe_strncpy(func_name_temp, type_stop + 1, sizeof(func_name_temp)); char *param_begin = strchr(func_name_temp, '('); if (!param_begin) { @@ -296,7 +295,7 @@ char *tpl_render(char *str) { // Append replacement value grow(z, &output_bytes, &output); - strncat(output, value, output_bytes - strlen(output) - 1); + safe_strncat(output, value, output_bytes); guard_free(value); output[z] = 0; } |
