about summary refs log tree commit diff homepage
path: root/runtime/klee-libc/strchr.c
blob: 50f1b9f41cc61ac2af425e66fe5f811b7d6de1a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*===-- strchr.c ----------------------------------------------------------===//
//
//                     The KLEE Symbolic Virtual Machine
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===*/

char *strchr(const char *p, int ch) {
  char c;

  c = ch;
  for (;; ++p) {
    if (*p == c) {
      return ((char *)p);
    } else if (*p == '\0') {
      return 0;
    }
  }
  /* NOTREACHED */  
  return 0;
}