ucspi-ssl  0.99e
TLS encryption for IPv6 communication
byte_chr.c
Go to the documentation of this file.
1 /* Public domain. */
2 
3 #include "byte.h"
4 
5 unsigned int byte_chr(s,n,c)
6 const char *s;
7 register unsigned int n;
8 int c;
9 {
10  register char ch;
11  register const char *t;
12 
13  ch = c;
14  t = s;
15  for (;;) {
16  if (!n) break; if (*t == ch) break; ++t; --n;
17  if (!n) break; if (*t == ch) break; ++t; --n;
18  if (!n) break; if (*t == ch) break; ++t; --n;
19  if (!n) break; if (*t == ch) break; ++t; --n;
20  }
21  return t - s;
22 }
unsigned int byte_chr(char *s, unsigned int n, int c) const
Definition: byte_chr.c:5