File:  [DVB] / dietlibc / lib / memchr.c
Revision 1.5: download - view: text, annotated - select for diffs
Fri Mar 26 23:28:13 2004 UTC (20 years, 2 months ago) by leitner
Branches: MAIN
CVS tags: HEAD
bglibs test suite breakage traced to memchr.c

#include <string.h>
#include "dietfeatures.h"
#include "dietstring.h"

void* memchr(const void *s, int c, size_t n) {
  const unsigned char *pc = (unsigned char *) s;
  for (;n--;pc++)
    if (*pc == c)
      return ((void *) pc);
  return 0;
}

LinuxTV legacy CVS <linuxtv.org/cvs>