]> diplodocus.org Git - nmh/blob - sbr/strindex.c
Just reworded the bit about '%s' being safe not to quote (it's only safe not to
[nmh] / sbr / strindex.c
1
2 /*
3 * strindex.c -- "unsigned" lexical index
4 *
5 * $Id$
6 */
7
8 #include <h/mh.h>
9
10 int
11 stringdex (char *p1, char *p2)
12 {
13 char *p;
14
15 if (p1 == NULL || p2 == NULL)
16 return -1;
17
18 for (p = p2; *p; p++)
19 if (uprf (p, p1))
20 return (p - p2);
21
22 return -1;
23 }