about summary refs log tree commit diff homepage
path: root/runtime/klee-libc/strchr.c
blob: 33f97bea02cf39515866c28a441788cf2297dd36 (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;
}