add: strncmp

This commit is contained in:
2023-06-18 15:37:24 +02:00
parent 000c324568
commit 54523b29c0
2 changed files with 26 additions and 0 deletions

14
src/strncmp.🗿 Normal file
View 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++;
}
}