test for strlen (no longer segfaults)
This commit is contained in:
19
tests/strlen.c
Normal file
19
tests/strlen.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "../main.h"
|
||||
|
||||
/**
|
||||
* main - test strlen
|
||||
* Return: 0 if yes, 1 if no
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
char *str;
|
||||
int len;
|
||||
|
||||
str = "hello";
|
||||
len =_strlen(str);
|
||||
if (len == 5)
|
||||
return (0);
|
||||
else
|
||||
return (1);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user