Browse Source

Ajout de la fonction srtcat et modification du 0 de la police de la Graph 90+E

compat
Antoine 3 months ago
parent
commit
8cbd5be038
2 changed files with 11 additions and 0 deletions
  1. 3
    0
      include/gint/std/string.h
  2. 8
    0
      src/std/string.c

+ 3
- 0
include/gint/std/string.h View File

@@ -19,4 +19,7 @@ size_t strlen(char const *str);
/* strncpy(): Copy a string with a size limit*/
char *strncpy(char *dst, char const *src, size_t n);

/* strcat(): Concatenation of src in dest*/
char *strcat(char *dest, const char *src);

#endif /* GINT_STD_STRING */

+ 8
- 0
src/std/string.c View File

@@ -19,3 +19,11 @@ GWEAK char *strncpy(char *dst, const char *src, size_t n)
while(i < n && (dst[i] = src[i])) i++;
return dst;
}

GWEAK char *strcat(char *dest, const char *src)
{
unsigned long fin_dest = strlen(dest);
unsigned int i;
for (i = 0 ; i <= strlen(src) ; i++) dest[fin_dest + i] = src[i];
return dest;
}

Loading…
Cancel
Save