From cd5f69cbc0d4bc34a509b5f6f62234e25893b684 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 9 Dec 2021 09:58:00 +0100 Subject: tests: setprop_inplace: use xstrdup instead of unchecked strdup This is the only strdup instance we have, all others are xstrdup. As strdup is _POSIX_C_SOURCE >= v200809L, which we don't require and we don't check strdup error return here, switch to xstrdup instead. This aligns the test with others that call xfuncs, mainly xmalloc(). Signed-off-by: Ahmad Fatoum Signed-off-by: David Gibson --- tests/setprop_inplace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/setprop_inplace.c b/tests/setprop_inplace.c index 7e1198d..61a0da1 100644 --- a/tests/setprop_inplace.c +++ b/tests/setprop_inplace.c @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) TEST_STRING_1); verbose_printf("Old string value was \"%s\"\n", strp); - xstr = strdup(strp); + xstr = xstrdup(strp); xlen = strlen(xstr); for (i = 0; i < xlen; i++) xstr[i] = toupper(xstr[i]); -- cgit v1.1