summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-19 22:27:11 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-19 22:27:11 +0200
commit62afe606a355581c5b48cca361478c43fb6ae4cf (patch)
treea278fe2fdf44c296892616554743b9d380ff7afa /src/main.c
parentAdded joe-sh_history to gitignore (diff)
download42-minishell-62afe606a355581c5b48cca361478c43fb6ae4cf.tar.gz
42-minishell-62afe606a355581c5b48cca361478c43fb6ae4cf.tar.bz2
42-minishell-62afe606a355581c5b48cca361478c43fb6ae4cf.tar.xz
42-minishell-62afe606a355581c5b48cca361478c43fb6ae4cf.tar.zst
42-minishell-62afe606a355581c5b48cca361478c43fb6ae4cf.zip
Well well well that wasn't too bad, now remake everything
Diffstat (limited to '')
-rw-r--r--src/main.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 618530d..beafbb5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -15,21 +15,26 @@
#include <minishell.h>
#include <stdlib.h>
#include <stddef.h>
+#include <stdint.h>
#include <unistd.h>
-#include <inttypes.h>
int
- main(void)
+main(int argc,
+ const char *argv[],
+ const char *envp[])
{
char *arg;
- int gnlret;
+ int8_t gnlret;
- ft_putstr(FT_PS1);
- while ((gnlret= get_next_line(STDIN_FILENO, &arg)) > 0)
+ (void)argc;
+ (void)argv;
+ (void)envp;
+ ft_printf(FT_PS1);
+ while ((gnlret = get_next_line(STDIN_FILENO, &arg)) > 0)
{
ft_process_arg(arg);
- free(arg);
- ft_putstr(FT_PS1);
+ ft_memdel((void*)&arg);
+ ft_printf(FT_PS1);
}
free(arg);
return (0);