summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/c_init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/c_init.c b/src/c_init.c
index 59cb5fa..4bfcf26 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -157,8 +157,9 @@ short
msh->sig = 0;
tcaps.plen = (unsigned int)m_plen(msh->ps[psx - 1]);
*line = NULL;
- if (!(*line = ft_calloc(sizeof(char), 1)))
- return (-1);
+ if (*line == NULL)
+ if (!(*line = ft_calloc(sizeof(char), 1)))
+ return (-1);
if (!(c_get_win_size(&tcaps.ws)))
return (-1);
while (!(ft_strchr(nread, '\n')))