Seluj78/Minishell

View on GitHub
libft/ft_striter.c

Summary

Maintainability
Test Coverage
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_striter.c                                       :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: jlasne <marvin@42.fr>                      +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2016/11/03 15:58:47 by jlasne            #+#    #+#             */
/*   Updated: 2016/11/03 16:00:28 by jlasne           ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "libft.h"

void    ft_striter(char *s, void (*f)(char *))
{
    int i;

    i = 0;
    if (s == NULL || f == NULL)
        return ;
    while (s[i])
    {
        f(&s[i]);
        i++;
    }
}