OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [libiberty/] [strchr.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/* Portable version of strchr()
2
   This function is in the public domain.  */
3
 
4
/*
5
NAME
6
        strchr -- return pointer to first occurance of a character
7
 
8
SYNOPSIS
9
        char *strchr (const char *s, int c)
10
 
11
DESCRIPTION
12
        Returns a pointer to the first occurance of character C in
13
        string S, or a NULL pointer if no occurance is found.
14
 
15
BUGS
16
        Behavior when character is the null character is implementation
17
        dependent.
18
*/
19
 
20
#include <ansidecl.h>
21
 
22
char *
23
strchr (s, c)
24
  register const char *s;
25
  int c;
26
{
27
  do {
28
    if (*s == c)
29
      {
30
        return (char*)s;
31
      }
32
  } while (*s++);
33
  return (0);
34
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.