1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-30 02:12:30 +01:00

Use -lbsd for strlcat/strlcpy, if needed and available

On BSD systems, strlcat and strlcpy are included in the C library and
nothing special is needed. On Linux systems they are not, but libbsd may
be available to provide them. Use it if so.

This also adds wstrlcat and wstrlcpy instead of trying to maybe-provide
strlcat and strlcpy themselves, as that way there is no risk of symbol
conflicts. Not bumping the library version at this time, that should be
done (if necessary) before release.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
This commit is contained in:
Brad Jorsch
2010-09-24 14:37:57 -04:00
committed by Carlos R. Mafra
parent f206c15fea
commit 8ca05fd4be
4 changed files with 49 additions and 17 deletions

View File

@@ -222,6 +222,9 @@ char* wstrconcat(char *str1, char *str2);
* so always assign the returned address to avoid dangling pointers. */
char* wstrappend(char *dst, char *src);
size_t wstrlcpy(char *, const char *, size_t);
size_t wstrlcat(char *, const char *, size_t);
void wtokensplit(char *command, char ***argv, int *argc);
@@ -849,13 +852,6 @@ extern int WCErrorCode;
/*-------------------------------------------------------------------------*/
#ifndef HAVE_STRLCPY
size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCAT
size_t strlcat(char *, const char *, size_t);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */