Seluj78/Minishell

View on GitHub
libft/ft_strcat.c

Summary

Maintainability
Test Coverage
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_strcat.c                                        :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: jlasne <marvin@42.fr>                      +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2016/11/03 13:49:24 by jlasne            #+#    #+#             */
/*   Updated: 2016/11/03 13:49:30 by jlasne           ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "libft.h"

char    *ft_strcat(char *s1, char *s2)
{
    int        size;
    int        cpt;

    cpt = 0;
    size = ft_strlen(s1);
    while (s2[cpt])
        s1[size++] = s2[cpt++];
    s1[size] = '\0';
    return (s1);
}