diff --git a/x_string/src/x_string.c b/x_string/src/x_string.c index 01d3436..4c75ae5 100644 --- a/x_string/src/x_string.c +++ b/x_string/src/x_string.c @@ -32,9 +32,9 @@ void x_strcpy(char* dest, char* src, const int size_dest){ // compare two strings // return 0 if equal to eachother // return -1 if not -int x_strcmp (char* str1, char* str2){ - char* ptr1 = str1; - char* ptr2 = str2; +int x_strcmp (const char* str1, const char* str2){ + const char* ptr1 = str1; + const char* ptr2 = str2; while(*ptr1 != '\0' && *ptr2 != '\0'){ if(*ptr1 != *ptr2){ diff --git a/x_string/src/x_string.h b/x_string/src/x_string.h index c3618d9..8ccf9d3 100644 --- a/x_string/src/x_string.h +++ b/x_string/src/x_string.h @@ -3,7 +3,7 @@ int x_strlen(char*); void x_strcpy(char*, char*, const int); -int x_strcmp(char*, char*); +int x_strcmp(const char*, const char*); char* x_strconcat(char*, char*); #endif