mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-05-11 15:08:47 +02:00
「✨」 feat(builtins/export): export possibly done
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/10/31 12:42:36 by mmoussou #+# #+# */
|
||||
/* Updated: 2024/04/30 11:03:32 by mmoussou ### ########.fr */
|
||||
/* Updated: 2024/07/11 15:25:29 by mmoussou ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -14,10 +14,27 @@
|
||||
|
||||
uint ft_strlen(const char *s)
|
||||
{
|
||||
const char *endptr;
|
||||
uint result;
|
||||
|
||||
endptr = s;
|
||||
while (*endptr)
|
||||
endptr++;
|
||||
return (endptr - s);
|
||||
result = 0;
|
||||
if (!s)
|
||||
return (0);
|
||||
while (s[result])
|
||||
result++;
|
||||
return (result);
|
||||
}
|
||||
|
||||
uint ft_vstrlen(int len, ...)
|
||||
{
|
||||
va_list argsl;
|
||||
int total_len;
|
||||
|
||||
va_start(argsl, len);
|
||||
total_len = 0;
|
||||
while (len)
|
||||
{
|
||||
total_len += ft_strlen(va_arg(argsl, const char *));
|
||||
len--;
|
||||
}
|
||||
return (total_len);
|
||||
}
|
||||
|
Reference in New Issue
Block a user