summaryrefslogtreecommitdiffstats
path: root/byte_chr.c
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
committermanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
commit69aec538b456402170dc723af417ba5c05389c32 (patch)
treee6f34c543f17c6392447ea337b2e2868212424d1 /byte_chr.c
downloadqmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz
qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2
qmail-69aec538b456402170dc723af417ba5c05389c32.zip
qmail 1.03 import
Diffstat (limited to 'byte_chr.c')
-rw-r--r--byte_chr.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/byte_chr.c b/byte_chr.c
new file mode 100644
index 0000000..f81dde8
--- /dev/null
+++ b/byte_chr.c
@@ -0,0 +1,20 @@
1#include "byte.h"
2
3unsigned int byte_chr(s,n,c)
4char *s;
5register unsigned int n;
6int c;
7{
8 register char ch;
9 register char *t;
10
11 ch = c;
12 t = s;
13 for (;;) {
14 if (!n) break; if (*t == ch) break; ++t; --n;
15 if (!n) break; if (*t == ch) break; ++t; --n;
16 if (!n) break; if (*t == ch) break; ++t; --n;
17 if (!n) break; if (*t == ch) break; ++t; --n;
18 }
19 return t - s;
20}