Make strstr take a const char* as a needle instead of a char*

This commit is contained in:
apio 2022-09-15 18:42:18 +02:00
parent 0b278b2be2
commit 18140a55ec
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ char* strncpy(char* dest, const char* src, size_t n);
int strncmp(const char* a, const char* b, size_t n);
char* strncat(char* dest, const char* src, size_t n);
char* strstr(char* haystack, char* needle);
char* strstr(char* haystack, const char* needle);
void* memcpy(void* dest, const void* src, size_t n);
void* memset(void* dest, int c, size_t n);

View File

@ -66,7 +66,7 @@ char* strcat(char* dest, const char* src)
return dest;
}
char* strstr(char* haystack, char* needle)
char* strstr(char* haystack, const char* needle)
{
size_t needle_size = strlen(needle);
size_t haystack_size = strlen(haystack);