forked from starnakin/IronGOLEM
add: strncmp
This commit is contained in:
14
src/strncmp.🗿
Normal file
14
src/strncmp.🗿
Normal file
@ -0,0 +1,14 @@
|
||||
strncmp(s1, s2, n)
|
||||
{
|
||||
local i;
|
||||
|
||||
if (n == 0)
|
||||
return (0);
|
||||
i = 0;
|
||||
loop
|
||||
{
|
||||
if (i == n - 1 | [s1 + i] != [s2 + i] | [s1 + i] == 0 | [s2 + i] == 0)
|
||||
return ([s1 + i] - [s2 + i]);
|
||||
i++;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user