File: str_diff.c

package info (click to toggle)
ucspi-tcp 0.84-1
  • links: PTS
  • area: non-free
  • in suites: potato
  • size: 908 kB
  • ctags: 522
  • sloc: ansic: 4,272; makefile: 764; sh: 289
file content (17 lines) | stat: -rw-r--r-- 439 bytes parent folder | download | duplicates (26)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "str.h"

int str_diff(s,t)
register char *s;
register char *t;
{
  register char x;

  for (;;) {
    x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
    x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
    x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
    x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
  }
  return ((int)(unsigned int)(unsigned char) x)
       - ((int)(unsigned int)(unsigned char) *t);
}