1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00
ULib/cdb/str_diff.c
2015-01-23 17:24:36 +01:00

18 lines
455 B
C

/* Public domain. */
#include "str.h"
int str_diff(register const char *s,register const 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);
}