diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2011-11-02 13:26:08 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-11-02 16:34:43 -0500 |
commit | 856d226851b5fb24d919f3233ca5764ef75bed24 (patch) | |
tree | 4eca62b68bad51b4e0966a2f5ee39fa8e16b29af /src/lib/string.C | |
parent | 022876203657ff7d370ea00e520b97432d1e8af5 (diff) | |
download | talos-hostboot-856d226851b5fb24d919f3233ca5764ef75bed24.tar.gz talos-hostboot-856d226851b5fb24d919f3233ca5764ef75bed24.zip |
Add strchr function.
Change-Id: Ia9eeb1c4c6cb47409fbfdb0f267eb9943a83dad4
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/480
Tested-by: Jenkins Server
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Diffstat (limited to 'src/lib/string.C')
-rw-r--r-- | src/lib/string.C | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/string.C b/src/lib/string.C index 5eca78439..fdfa06280 100644 --- a/src/lib/string.C +++ b/src/lib/string.C @@ -164,3 +164,14 @@ extern "C" size_t strlen(const char* a) } return length; } + +extern "C" char* strchr(const char* s, int c) +{ + while((*s != '\0') && (*s != c)) + { + s++; + } + + if (*s == c) return (char*)s; + return NULL; +} |