diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-12-09 09:58:00 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2021-12-28 20:10:57 +1100 |
commit | cd5f69cbc0d4bc34a509b5f6f62234e25893b684 (patch) | |
tree | bc69df6b98f6ff372fcbc91e12f93f00536c4f08 /tests | |
parent | a04f69025003890be265e007238dc91041e5529b (diff) | |
download | dtc-cd5f69cbc0d4bc34a509b5f6f62234e25893b684.zip dtc-cd5f69cbc0d4bc34a509b5f6f62234e25893b684.tar.gz dtc-cd5f69cbc0d4bc34a509b5f6f62234e25893b684.tar.bz2 |
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/setprop_inplace.c | 2 |
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]); |