summaryrefslogtreecommitdiff
path: root/sh-i18n--envsubst.c
diff options
context:
space:
mode:
Diffstat (limited to 'sh-i18n--envsubst.c')
-rw-r--r--sh-i18n--envsubst.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sh-i18n--envsubst.c b/sh-i18n--envsubst.c
index 855d28cf94..6dd03a974a 100644
--- a/sh-i18n--envsubst.c
+++ b/sh-i18n--envsubst.c
@@ -278,9 +278,7 @@ static string_list_ty variables_set;
static void
note_variable (const char *var_ptr, size_t var_len)
{
- char *string = xmalloc (var_len + 1);
- memcpy (string, var_ptr, var_len);
- string[var_len] = '\0';
+ char *string = xmemdupz (var_ptr, var_len);
string_list_append (&variables_set, string);
}