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:
parent
bdb1e2ec56
commit
4b194d7bc7
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue