tests: 70-strchr.c: Rewrite for TinyCC.

* lib/tests/string/70-strchr.c (main): Use char* hello for comparison.
Allows for duplication of "hello" string.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-11-29 10:27:36 +01:00
parent 614c9146ba
commit 8c85bccd56
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 3 additions and 4 deletions

View File

@ -38,12 +38,11 @@ strchr (char const *s, int c)
int
main ()
{
char *p = strchr ("hello", 'l');
char *hello = "hello";
char *p = strchr (hello, 'l');
if (!p)
return 1;
int i = p - "hello";
// int i;
// i = p - "hello";
int i = p - hello;
if (i != 2)
return i;