diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-02 13:10:15 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-02 13:10:15 -0400 |
| commit | 096441a470af4b9255aa1696daadad214907132f (patch) | |
| tree | bd50ab2678b41843be174d929f98fd4cb7dffd92 /src | |
| parent | c90c3a9a97ebaac438f89f09ff28db60c2cd714b (diff) | |
| download | stasis-096441a470af4b9255aa1696daadad214907132f.tar.gz | |
Replace string functions
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/core/strlist.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/core/strlist.c b/src/lib/core/strlist.c index 5cd3f4a..60f3a1f 100644 --- a/src/lib/core/strlist.c +++ b/src/lib/core/strlist.c @@ -88,8 +88,7 @@ int strlist_append_file(struct StrList *pStrList, char *_path, ReaderFn *readerF if (is_url) { int fd; char tempfile[PATH_MAX] = {0}; - strncpy(tempfile, "/tmp/.remote_file.XXXXXX", sizeof(tempfile) - 1); - tempfile[sizeof(tempfile) - 1] = '\0'; + safe_strncpy(tempfile, "/tmp/.remote_file.XXXXXX", sizeof(tempfile)); if ((fd = mkstemp(tempfile)) < 0) { retval = -1; @@ -449,8 +448,7 @@ void strlist_set(struct StrList **pStrList, size_t index, char *value) { const size_t len = strlen(value) + 1; memset((*pStrList)->data[index], '\0', len); - strncpy((*pStrList)->data[index], value, len); - (*pStrList)->data[index][len] = '\0'; + safe_strncpy((*pStrList)->data[index], value, len); } } |
