aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-12-09 09:58:00 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2021-12-28 20:10:57 +1100
commitcd5f69cbc0d4bc34a509b5f6f62234e25893b684 (patch)
treebc69df6b98f6ff372fcbc91e12f93f00536c4f08
parenta04f69025003890be265e007238dc91041e5529b (diff)
downloaddtc-cd5f69cbc0d4bc34a509b5f6f62234e25893b684.tar.gz
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 <a.fatoum@pengutronix.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--tests/setprop_inplace.c2
1 files changed, 1 insertions, 1 deletions
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]);