summaryrefslogtreecommitdiff
path: root/lib/string/string.c
blob: bdd92c9e18d21490f6affa29a02d164f49011a72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "lib/bool/bool.h"


//length 0 for null terminated strings;
bool strcmp(char *str1, char *str2, int length)
{
    int i=0;
    while(true)
    {
	if(str1[i]!=str2[i])return false;
	i++;

	if(i==length) return true;
	if(length==0&&str1[i]==0&&str2[i]==0) return true;
    }
}