diff options
author | Jeremy Allison <jra@samba.org> | 2011-05-03 13:10:01 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-05-04 12:12:13 -0700 |
commit | 017e0c8d95fe8212b006e1c14aef8d96fed30674 (patch) | |
tree | 3bb209bc92d298d17255a69713981a7df18d0b8b /lib/util/tests | |
parent | deba880986b1029fa059fcfba9b2a72abf598a9b (diff) | |
download | samba-017e0c8d95fe8212b006e1c14aef8d96fed30674.tar.gz samba-017e0c8d95fe8212b006e1c14aef8d96fed30674.tar.bz2 samba-017e0c8d95fe8212b006e1c14aef8d96fed30674.zip |
Fix simple uses of safe_strcpy -> strlcpy. Easy ones where we just remove -1.
Diffstat (limited to 'lib/util/tests')
-rw-r--r-- | lib/util/tests/str.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/util/tests/str.c b/lib/util/tests/str.c index b4c45e3751..f9f3abf731 100644 --- a/lib/util/tests/str.c +++ b/lib/util/tests/str.c @@ -25,7 +25,7 @@ static bool test_string_sub_simple(struct torture_context *tctx) { char tmp[100]; - safe_strcpy(tmp, "foobar", sizeof(tmp)-1); + strlcpy(tmp, "foobar", sizeof(tmp)); string_sub(tmp, "foo", "bar", sizeof(tmp)); torture_assert_str_equal(tctx, tmp, "barbar", "invalid sub"); return true; @@ -34,7 +34,7 @@ static bool test_string_sub_simple(struct torture_context *tctx) static bool test_string_sub_multiple(struct torture_context *tctx) { char tmp[100]; - safe_strcpy(tmp, "fooblafoo", sizeof(tmp)-1); + strlcpy(tmp, "fooblafoo", sizeof(tmp)); string_sub(tmp, "foo", "bar", sizeof(tmp)); torture_assert_str_equal(tctx, tmp, "barblabar", "invalid sub"); return true; @@ -43,7 +43,7 @@ static bool test_string_sub_multiple(struct torture_context *tctx) static bool test_string_sub_longer(struct torture_context *tctx) { char tmp[100]; - safe_strcpy(tmp, "foobla", sizeof(tmp)-1); + strlcpy(tmp, "foobla", sizeof(tmp)); string_sub(tmp, "foo", "blie", sizeof(tmp)); torture_assert_str_equal(tctx, tmp, "bliebla", "invalid sub"); return true; @@ -52,7 +52,7 @@ static bool test_string_sub_longer(struct torture_context *tctx) static bool test_string_sub_shorter(struct torture_context *tctx) { char tmp[100]; - safe_strcpy(tmp, "foobla", sizeof(tmp)-1); + strlcpy(tmp, "foobla", sizeof(tmp)); string_sub(tmp, "foo", "bl", sizeof(tmp)); torture_assert_str_equal(tctx, tmp, "blbla", "invalid sub"); return true; @@ -61,7 +61,7 @@ static bool test_string_sub_shorter(struct torture_context *tctx) static bool test_string_sub_special_char(struct torture_context *tctx) { char tmp[100]; - safe_strcpy(tmp, "foobla", sizeof(tmp)-1); + strlcpy(tmp, "foobla", sizeof(tmp)); string_sub(tmp, "foo", "%b;l", sizeof(tmp)); torture_assert_str_equal(tctx, tmp, "_b_lbla", "invalid sub"); return true; |