diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-05-16 12:47:44 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-05-16 12:47:44 +0000 |
| commit | 88d54cd78bf73348e4f207ab3f741aa374f28b1c (patch) | |
| tree | d9310acf36b480d31f0c1527520fe7376f7953ca /src/flstring.h | |
| parent | 36546824762618bbe76d4ac72b632ca9927acd9f (diff) | |
Massive update to use strlcpy() and strlcat() instead of strncpy()
and strncat() in almost all places (there are still a few strncpy's
that need to be used...)
Added configure check for strlcat() and strlcpy().
Added emulation code for strlcat() and strlcpy().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2239 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/flstring.h')
| -rw-r--r-- | src/flstring.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/flstring.h b/src/flstring.h index f92404a5a..e3f612623 100644 --- a/src/flstring.h +++ b/src/flstring.h @@ -1,9 +1,9 @@ /* - * "$Id: flstring.h,v 1.1.2.5 2002/04/29 20:56:19 easysw Exp $" + * "$Id: flstring.h,v 1.1.2.6 2002/05/16 12:47:43 easysw Exp $" * * Common string header file for the Fast Light Tool Kit (FLTK). * - * Copyright 1998-2001 by Bill Spitzak and others. + * Copyright 1998-2002 by Bill Spitzak and others. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -66,11 +66,26 @@ extern int fl_vsnprintf(char *, size_t, const char *, va_list ap); # define vsnprintf fl_vsnprintf # endif /* !HAVE_VSNPRINTF */ +/* + * strlcpy() and strlcat() are some really useful BSD string functions + * that work the way strncpy() and strncat() *should* have worked. + */ + +# if !HAVE_STRLCAT +extern size_t fl_strlcat(char *, const char *, size_t); +# define strlcat fl_strlcat +# endif /* !HAVE_STRLCAT */ + +# if !HAVE_STRLCPY +extern size_t fl_strlcpy(char *, const char *, size_t); +# define strlcpy fl_strlcpy +# endif /* !HAVE_STRLCPY */ + # ifdef __cplusplus } # endif /* __cplusplus */ #endif /* !flstring_h */ /* - * End of "$Id: flstring.h,v 1.1.2.5 2002/04/29 20:56:19 easysw Exp $". + * End of "$Id: flstring.h,v 1.1.2.6 2002/05/16 12:47:43 easysw Exp $". */ |
