-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_env_geti.c
23 lines (20 loc) · 1.03 KB
/
ft_env_geti.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_env_geti.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abenamar <abenamar@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/08/08 14:25:15 by abenamar #+# #+# */
/* Updated: 2023/08/08 15:19:56 by abenamar ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int ft_env_geti(t_list **env, char *key)
{
char *var;
var = ft_env_gets(env, key);
if (!var)
return (0);
return (ft_atoi(var));
}