-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstr_diffn.c
61 lines (57 loc) · 869 Bytes
/
str_diffn.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* $Log: str_diffn.c,v $
* Revision 1.1 2024-04-22 08:02:34+05:30 Cprogrammer
* Initial revision
*
*/
#include "str.h"
int
str_diffn(register const char *s, register const char *t, unsigned int len)
{
register char x;
for (;;) {
if (!len--)
return 0;
x = *s;
if (x != *t)
break;
if (!x)
break;
++s;
++t;
if (!len--)
return 0;
x = *s;
if (x != *t)
break;
if (!x)
break;
++s;
++t;
if (!len--)
return 0;
x = *s;
if (x != *t)
break;
if (!x)
break;
++s;
++t;
if (!len--)
return 0;
x = *s;
if (x != *t)
break;
if (!x)
break;
++s;
++t;
}
return ((int) (unsigned int) (unsigned char) x) - ((int) (unsigned int) (unsigned char) *t);
}
void
getversion_str_diffn_c()
{
static char *x = "$Id: str_diffn.c,v 1.1 2024-04-22 08:02:34+05:30 Cprogrammer Exp mbhangui $";
x++;
}