maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
ft_strcpy.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_strcpy.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: rmikhayl <rmikhayl@student.42london.c +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2023/12/17 17:25:27 by rmikhayl #+# #+# */
9
/* Updated: 2024/06/05 17:17:04 by rmikhayl ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include "
libft.h
"
14
15
/* *************************** ft_strlcpy *********************************** */
16
/* Copies text from 'src' to 'dst' ensuring it fits within 'size' */
17
/* characters. Returns the length of the copied text. If something's */
18
/* missing or 'size' is too small, it won't work as intended. */
19
/* */
20
/* In layman's terms: It's like copying a passage from one page to another, */
21
/* making sure it fits without cutting off any words. If there's not enough */
22
/* space or some content is missing, it won't be a perfect copy. */
23
/* ************************************************************************** */
24
25
char
*
ft_strcpy
(
char
*dest,
const
char
*src)
26
{
27
unsigned
int
i;
28
29
i = 0;
30
while
(src[i] !=
'\0'
)
31
{
32
dest[i] = src[i];
33
i++;
34
}
35
dest[i] = src[i];
36
return
(dest);
37
}
ft_strcpy
char * ft_strcpy(char *dest, const char *src)
Definition
ft_strcpy.c:25
libft.h
lib
libft
src
ft_strcpy.c
Generated by
1.9.8