42_minishell/utils/ft_strshift.c

31 lines
1.1 KiB
C
Raw Normal View History

2023-02-15 14:52:27 -05:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 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++;
}
}
}