projects
/
mes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
18cb982
)
mescc: Tinycc support: strchr.
author
Jan Nieuwenhuizen
<janneke@gnu.org>
Sun, 30 Jul 2017 10:55:58 +0000
(12:55 +0200)
committer
Jan Nieuwenhuizen
<janneke@gnu.org>
Sun, 30 Jul 2017 10:55:58 +0000
(12:55 +0200)
* mlibc/libc-mes+tcc.c (strchr): Implement.
mlibc/libc-mes+tcc.c
patch
|
blob
|
history
diff --git
a/mlibc/libc-mes+tcc.c
b/mlibc/libc-mes+tcc.c
index b70cb3cbced6818449726ad31e286d9e4d75b78c..1b917d2f0bc1532c08b446df068d45015a53a6bd 100644
(file)
--- a/
mlibc/libc-mes+tcc.c
+++ b/
mlibc/libc-mes+tcc.c
@@
-277,7
+277,12
@@
strcat (char *dest, char const *src)
char *
strchr (char const *s, int c)
{
char *
strchr (char const *s, int c)
{
- eputs ("strchr stub\n");
+ char const *p = s;
+ while (*p || !c)
+ {
+ if (c == *p) return p;
+ *p++;
+ }
return 0;
}
return 0;
}