summaryrefslogtreecommitdiff
path: root/lib/string/string.c
blob: 45d8ad17d06718e82fa27cc91c3d0b6f52e8c44d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#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||str1[i]==str2[i]==0) return true;
    }
}