File: case_diffs.c

package info (click to toggle)
ucspi-tcp 1%3A0.88-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,084 kB
  • ctags: 690
  • sloc: ansic: 5,613; makefile: 718; sh: 153
file content (17 lines) | stat: -rw-r--r-- 387 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "case.h"

int case_diffs(register char *s,register char *t)
{
  register unsigned char x;
  register unsigned char y;

  for (;;) {
    x = *s++ - 'A';
    if (x <= 'Z' - 'A') x += 'a'; else x += 'A';
    y = *t++ - 'A';
    if (y <= 'Z' - 'A') y += 'a'; else y += 'A';
    if (x != y) break;
    if (!x) break;
  }
  return ((int)(unsigned int) x) - ((int)(unsigned int) y);
}