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

#include <string.h>

char *strrchr(const char *t, int c) {
  char ch;
  const char *l=0;

  ch = c;
  for (;;) {
    if (*t == ch) l=t; if (!*t) return (char*)l; ++t;
  }
  return (char*)l;
}