Mercurial > hg > toybox
comparison lib/lib.h @ 167:f16c8e5e9435
Replace strlcpy() with xstrcpy(), which exits if the string won't fit.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 19 Nov 2007 01:51:00 -0600 |
parents | 5f1d3ad8a888 |
children | 29e2051296fd |
comparison
equal
deleted
inserted
replaced
166:5f1d3ad8a888 | 167:f16c8e5e9435 |
---|---|
34 struct dirtree *dirtree_add_node(char *path); | 34 struct dirtree *dirtree_add_node(char *path); |
35 struct dirtree *dirtree_read(char *path, struct dirtree *parent, | 35 struct dirtree *dirtree_read(char *path, struct dirtree *parent, |
36 int (*callback)(struct dirtree *node)); | 36 int (*callback)(struct dirtree *node)); |
37 | 37 |
38 // lib.c | 38 // lib.c |
39 #if !defined(__UCLIBC__) && !defined(__KLIBC__) | 39 void xstrcpy(char *dest, char *src, size_t size); |
40 void strlcpy(char *dest, char *src, size_t size); | |
41 #endif | |
42 | |
43 void verror_msg(char *msg, int err, va_list va); | 40 void verror_msg(char *msg, int err, va_list va); |
44 void error_msg(char *msg, ...); | 41 void error_msg(char *msg, ...); |
45 void perror_msg(char *msg, ...); | 42 void perror_msg(char *msg, ...); |
46 void error_exit(char *msg, ...) noreturn; | 43 void error_exit(char *msg, ...) noreturn; |
47 void perror_exit(char *msg, ...) noreturn; | 44 void perror_exit(char *msg, ...) noreturn; |