summaryrefslogtreecommitdiff
path: root/util/libreboot-utils
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-25 00:44:13 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-25 00:44:13 +0000
commit7efdc40cab3118bcf005cce0293d80d08cce6d0c (patch)
treea72b5721c63a3dd493ff95d55de73e6bd029acb1 /util/libreboot-utils
parent1228f7e0e5ade7ff10b4f494097e3f7eb45fd795 (diff)
lib/mkhtemp: rename suffix to template
suffix is a gnu term, for its mktemp version. it goes after the template. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils')
-rw-r--r--util/libreboot-utils/lib/mkhtemp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/util/libreboot-utils/lib/mkhtemp.c b/util/libreboot-utils/lib/mkhtemp.c
index 377ec206..3d9a9f6e 100644
--- a/util/libreboot-utils/lib/mkhtemp.c
+++ b/util/libreboot-utils/lib/mkhtemp.c
@@ -79,8 +79,8 @@ new_tmp_common(int *fd, char **path, int type,
#endif
struct stat st;
- const char *suffix;
- size_t suffix_len;
+ const char *templatestr;
+ size_t templatestr_len;
size_t dirlen;
size_t destlen;
@@ -144,17 +144,17 @@ new_tmp_common(int *fd, char **path, int type,
goto err;
if (template != NULL)
- suffix = template;
+ templatestr = template;
else
- suffix = "tmp.XXXXXXXXXX";
+ templatestr = "tmp.XXXXXXXXXX";
- if (slen(suffix, maxlen, &suffix_len) < 0)
+ if (slen(templatestr, maxlen, &templatestr_len) < 0)
goto err;
/* sizeof adds an extra byte, useful
* because we also want '.' or '/'
*/
- destlen = dirlen + 1 + suffix_len;
+ destlen = dirlen + 1 + templatestr_len;
if (destlen > maxlen - 1) {
errno = EOVERFLOW;
goto err;
@@ -168,7 +168,7 @@ new_tmp_common(int *fd, char **path, int type,
memcpy(dest, tmpdir, dirlen);
*(dest + dirlen) = '/';
- memcpy(dest + dirlen + 1, suffix, suffix_len);
+ memcpy(dest + dirlen + 1, templatestr, templatestr_len);
*(dest + destlen) = '\0';
fname = dest + dirlen + 1;
@@ -622,7 +622,7 @@ mkhtemp(int *fd,
if((fname_copy = malloc(fname_len + 1)) == NULL)
goto err;
- /* fname_copy = suffix region only; p points to trailing XXXXXX */
+ /* fname_copy = templatestr region only; p points to trailing XXXXXX */
memcpy(fname_copy,
template + len - fname_len,
fname_len + 1);