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