Files
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

49 lines
847 B
C
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*********************************************************************
* STRCMP - compares strings
*
*
* WORD strcmp(s1,s2)
* BYTE *s1, *s2;
*
* 'strcmp' compares null terminated strings s1 and s2.
* Returns:
* strcmp < 0 if s1<s2
* strcmp = 0 if s1=s2
* strcmp > 0 if s1>s2
*********************************************************************/
#include <portab.h>
WORD strcmp(s1,s2) /* CLEAR FUNCTION ***********/
REG BYTE *s1, *s2;
{
REG BYTE a,b;
while (*s1 && *s2)
{
a = (*s1++);
b = (*s2++);
if (a > b) return (1);
if (a < b) return (-1);
}
return(*s1 - *s2);
}

{
a = (*s1++);
b = (*s2++);
if (a > b) return (1);
if (a < b) return (-1);
}
return(*s1 - *s2);
}

{
a = (*s1++);
b = (*s2++);
if (a > b) return (1);
if (a < b) return (-1);
}
return(*s1 - *s2);
}