Skip to content

Commit 0f9f5e3

Browse files
author
Shell-thon
committed
task 0
1 parent 8b93e44 commit 0f9f5e3

20 files changed

+9
-11
lines changed

0x18-dynamic_libraries/0-isupper.o

1.37 KB
Binary file not shown.

0x18-dynamic_libraries/0-memset.o

1.39 KB
Binary file not shown.

0x18-dynamic_libraries/0-strcat.o

1.45 KB
Binary file not shown.

0x18-dynamic_libraries/1-isdigit.o

1.37 KB
Binary file not shown.

0x18-dynamic_libraries/1-memcpy.o

1.4 KB
Binary file not shown.

0x18-dynamic_libraries/1-strncat.o

1.46 KB
Binary file not shown.

0x18-dynamic_libraries/100-atoic.o

1.49 KB
Binary file not shown.

0x18-dynamic_libraries/2-strchr.o

1.42 KB
Binary file not shown.

0x18-dynamic_libraries/2-strlen.o

1.38 KB
Binary file not shown.

0x18-dynamic_libraries/2-strncpy.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
#include "main.h"
22
/**
3-
* _strncat - concatenate two strings.
3+
* _strncat - C function that copies a string.
44
* @dest: Type char
55
* @src: Type char
66
* @n: Type int
77
*
88
* Return: dest
99
*/
10-
char *_strncat(char *dest, char *src, int n)
10+
char *_strncpy(char *dest, char *src, int n)
1111
{
12-
int a, b;
12+
int a, b, i;
1313

14-
for (a = 0; dest[a] != '\0'; a++)
15-
{
16-
}
17-
for (b = 0; b < n && src[b] != '\0'; b++)
18-
{
19-
dest[a + b] = src[b];
20-
}
21-
return (dest);
14+
for (i = 0; i < n && src[i] != '\0'; i++)
15+
dest[i] = src[i];
16+
17+
for ( ; i < n; i++)
18+
dest[i] = '\0';
19+
return (dest);
2220
}

0x18-dynamic_libraries/2-strncpy.o

1.45 KB
Binary file not shown.

0x18-dynamic_libraries/3-islower.o

1.37 KB
Binary file not shown.

0x18-dynamic_libraries/3-puts.o

1.6 KB
Binary file not shown.

0x18-dynamic_libraries/3-strspn.o

1.48 KB
Binary file not shown.

0x18-dynamic_libraries/4-isalpha.o

1.38 KB
Binary file not shown.

0x18-dynamic_libraries/4-strpbrk.o

1.46 KB
Binary file not shown.

0x18-dynamic_libraries/5-strstr.o

1.5 KB
Binary file not shown.

0x18-dynamic_libraries/6-abs.o

1.35 KB
Binary file not shown.

0x18-dynamic_libraries/9-strcpy.o

1.43 KB
Binary file not shown.

0x18-dynamic_libraries/libdynamic.so

16.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)