From 517cf2dd5b1cb7314a215f32b9b5470eefae540f Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 3 Nov 2020 17:28:09 +0100 Subject: plen fixed --- src/m_prompt.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/m_prompt.c') diff --git a/src/m_prompt.c b/src/m_prompt.c index 0fbd9f2..68126ff 100644 --- a/src/m_prompt.c +++ b/src/m_prompt.c @@ -59,10 +59,10 @@ static void m_update_psx(unsigned char x, t_msh *msh) ft_strlcpy(msh->ps[x - 1], var, 255); } -unsigned int m_plen(char *prompt) +size_t m_plen(char *prompt) { - unsigned int i; - unsigned int size; + size_t i; + size_t size; i = 0; size = 0; @@ -72,15 +72,13 @@ unsigned int m_plen(char *prompt) { while (prompt[i] != 'm' && prompt[i] != '\0') i++; + i++; } - if (ft_isalnum(prompt[i]) || - ft_ischarset("<>", prompt[i])) + else { size++; i++; } - else - i++; } return (size); } -- cgit v1.2.3