42_minishell/utils/ft_strshift.c
2023-02-15 20:52:27 +01:00

31 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strshift.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/15 14:11:04 by cchauvet #+# #+# */
/* Updated: 2023/02/15 18:16:50 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "utils.h"
void ft_strshift(char *str, int shift)
{
ssize_t i;
if (shift > 0)
return ;
else
{
i = 0;
while (str[i - shift - 1] != '\0')
{
str[i] = str[i - shift];
i++;
}
}
}