Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4279 → Rev 4280

/trunk/uspace/lib/libc/include/string.h
71,6 → 71,7
 
extern void str_cpy(char *dest, size_t size, const char *src);
extern void str_ncpy(char *dest, size_t size, const char *src, size_t n);
extern void str_append(char *dest, size_t size, const char *src);
 
extern void wstr_nstr(char *dst, const wchar_t *src, size_t size);
 
88,8 → 89,6
 
extern int stricmp(const char *, const char *);
 
extern char *strcat(char *, const char *);
 
extern long int strtol(const char *, char **, int);
extern unsigned long strtoul(const char *, char **, int);
 
/trunk/uspace/lib/libc/generic/string.c
529,6 → 529,25
dest[dest_off] = '\0';
}
 
/** Append one string to another.
*
* Append source string @a src to string in destination buffer @a dest.
* Size of the destination buffer is @a dest. If the size of the output buffer
* is at least one byte, the output string will always be well-formed, i.e.
* null-terminated and containing only complete characters.
*
* @param dst Destination buffer.
* @param count Size of the destination buffer.
* @param src Source string.
*/
void str_append(char *dest, size_t size, const char *src)
{
size_t dstr_size;
 
dstr_size = str_size(dest);
str_cpy(dest + dstr_size, size - dstr_size, src);
}
 
/** Copy NULL-terminated wide string to string
*
* Copy source wide string @a src to destination buffer @a dst.
820,17 → 839,6
return (sgn ? -number : number);
}
 
char *strcat(char *dest, const char *src)
{
char *orig = dest;
while (*dest++)
;
--dest;
while ((*dest++ = *src++))
;
return orig;
}
 
char *str_dup(const char *src)
{
size_t size = str_size(src);
/trunk/uspace/lib/libc/generic/vfs/vfs.c
87,7 → 87,7
}
ncwd_path_nc[0] = '\0';
}
strcat(ncwd_path_nc, path);
str_append(ncwd_path_nc, cwd_size + 1 + size + 1, path);
ncwd_path = canonify(ncwd_path_nc, retlen);
if (!ncwd_path) {
futex_up(&cwd_futex);