diff options
| author | Christian Jullien <jullien@sims3.eligis.com> | 2016-10-12 06:18:38 +0200 |
|---|---|---|
| committer | Christian Jullien <jullien@sims3.eligis.com> | 2016-10-12 06:18:38 +0200 |
| commit | 8986bc8af473080bed0efa01cb569f3e25f179a9 (patch) | |
| tree | 08555077f6841a1db663043d331f56e670ad8320 /tests/tests2/28_strings.c | |
| parent | 07ca2df5889ab526ba2de383707edb12e5d79323 (diff) | |
| download | tinycc-8986bc8af473080bed0efa01cb569f3e25f179a9.tar.gz tinycc-8986bc8af473080bed0efa01cb569f3e25f179a9.tar.bz2 | |
Use ISO C string functions instead of obsolete BSD ones that used to be in strings.h. It allows more systems -- i.e. Windows -- to use those tests
Diffstat (limited to 'tests/tests2/28_strings.c')
| -rw-r--r-- | tests/tests2/28_strings.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/tests2/28_strings.c b/tests/tests2/28_strings.c index 115fe09..2db2298 100644 --- a/tests/tests2/28_strings.c +++ b/tests/tests2/28_strings.c @@ -1,6 +1,5 @@ #include <stdio.h> #include <string.h> -#include <strings.h> int main() { @@ -26,9 +25,9 @@ int main() printf("%d\n", strncmp(a, "goerg", 2) == 0); printf("%d\n", strncmp(a, "zebra", 2) < 0); - printf("%s\n", index(a, 'o')); - printf("%s\n", rindex(a, 'l')); - printf("%d\n", rindex(a, 'x') == NULL); + printf("%s\n", strchr(a, 'o')); + printf("%s\n", strrchr(a, 'l')); + printf("%d\n", strrchr(a, 'x') == NULL); memset(&a[1], 'r', 4); printf("%s\n", a); |
