why does this segfault?

This commit is contained in:
LinlyBoi
2023-08-19 23:04:35 +03:00
parent 92738bbd3d
commit 51f1e32eb2
2 changed files with 3 additions and 3 deletions

2
main.h
View File

@@ -1,7 +1,7 @@
#ifndef MAIN_H_
#define MAIN_H_
int _printf(const char *format, ...);
int _contains(char *str, char c);
int _contains(const char *str, char c);
int _strlen(char *str);

View File

@@ -9,7 +9,7 @@
*/
int _strlen(char *str)
{
if (*str)
if (str)
return (1 + _strlen(str++));
else
return (0);
@@ -23,7 +23,7 @@ int _strlen(char *str)
*
* Return: number of unique cases of "%*" that aren't "%%"
*/
int _contains(char *str, char c)
int _contains(const char *str, char c)
{
if (*str)
{