ft_strncat.c 1.1 KB

123456789101112131415161718192021222324252627
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_strncat.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2014/11/21 11:41:39 by mazimi #+# #+# */
  9. /* Updated: 2014/12/02 16:05:11 by mazimi ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "../libft.h"
  13. char *ft_strncat(char *dest, const char *src, size_t n)
  14. {
  15. int i;
  16. size_t j;
  17. i = 0;
  18. j = 0;
  19. while (dest[i])
  20. i++;
  21. while (src[j] && j < n)
  22. dest[i++] = src[j++];
  23. return ((char *)dest);
  24. }