maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
isnum_from_str.c File Reference
#include "libft.h"
Include dependency graph for isnum_from_str.c:

Go to the source code of this file.

Functions

int isnum_from_str (const char *str)
 

Function Documentation

◆ isnum_from_str()

int isnum_from_str ( const char *  str)

Definition at line 15 of file isnum_from_str.c.

16{
17 if (!str || *str == '\0')
18 return (0);
19 if (*str == '-' || *str == '+')
20 {
21 str++;
22 if (*str == '\0')
23 return (0);
24 }
25 while (*str)
26 {
27 if (*str < '0' || *str > '9')
28 return (0);
29 str++;
30 }
31 return (1);
32}