mirror of
https://github.com/stefanocasazza/ULib.git
synced 2025-09-28 19:05:55 +08:00
18 lines
455 B
C
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);
|
|
}
|