Changeset 4482bc7 in mainline
- Timestamp:
- 2009-04-14T19:21:25Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6700ee2
- Parents:
- 732bb0c
- Location:
- uspace/lib/libc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/string.c
r732bb0c r4482bc7 530 530 } 531 531 532 /** Append one string to another. 533 * 534 * Append source string @a src to string in destination buffer @a dest. 535 * Size of the destination buffer is @a dest. If the size of the output buffer 536 * is at least one byte, the output string will always be well-formed, i.e. 537 * null-terminated and containing only complete characters. 538 * 539 * @param dst Destination buffer. 540 * @param count Size of the destination buffer. 541 * @param src Source string. 542 */ 543 void str_append(char *dest, size_t size, const char *src) 544 { 545 size_t dstr_size; 546 547 dstr_size = str_size(dest); 548 str_cpy(dest + dstr_size, size - dstr_size, src); 549 } 550 532 551 /** Copy NULL-terminated wide string to string 533 552 * … … 821 840 } 822 841 823 char *strcat(char *dest, const char *src)824 {825 char *orig = dest;826 while (*dest++)827 ;828 --dest;829 while ((*dest++ = *src++))830 ;831 return orig;832 }833 834 842 char *str_dup(const char *src) 835 843 { -
uspace/lib/libc/generic/vfs/vfs.c
r732bb0c r4482bc7 88 88 ncwd_path_nc[0] = '\0'; 89 89 } 90 str cat(ncwd_path_nc, path);90 str_append(ncwd_path_nc, cwd_size + 1 + size + 1, path); 91 91 ncwd_path = canonify(ncwd_path_nc, retlen); 92 92 if (!ncwd_path) { -
uspace/lib/libc/include/string.h
r732bb0c r4482bc7 72 72 extern void str_cpy(char *dest, size_t size, const char *src); 73 73 extern void str_ncpy(char *dest, size_t size, const char *src, size_t n); 74 extern void str_append(char *dest, size_t size, const char *src); 74 75 75 76 extern void wstr_nstr(char *dst, const wchar_t *src, size_t size); … … 89 90 extern int stricmp(const char *, const char *); 90 91 91 extern char *strcat(char *, const char *);92 93 92 extern long int strtol(const char *, char **, int); 94 93 extern unsigned long strtoul(const char *, char **, int);
Note:
See TracChangeset
for help on using the changeset viewer.