diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-03 17:28:09 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-03 17:28:09 +0100 |
commit | 517cf2dd5b1cb7314a215f32b9b5470eefae540f (patch) | |
tree | 2b5f151fd751232f4f0902ecfdf7a14c4ff70dd2 /src/m_prompt.c | |
parent | uhhhhhhhhh (diff) | |
download | 42-minishell-517cf2dd5b1cb7314a215f32b9b5470eefae540f.tar.gz 42-minishell-517cf2dd5b1cb7314a215f32b9b5470eefae540f.tar.bz2 42-minishell-517cf2dd5b1cb7314a215f32b9b5470eefae540f.tar.xz 42-minishell-517cf2dd5b1cb7314a215f32b9b5470eefae540f.tar.zst 42-minishell-517cf2dd5b1cb7314a215f32b9b5470eefae540f.zip |
plen fixed
Diffstat (limited to 'src/m_prompt.c')
-rw-r--r-- | src/m_prompt.c | 12 |
1 files changed, 5 insertions, 7 deletions
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); } |