X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=common.h;h=677219d621fc8e3579d5016d8255f5d295822325;hb=906474fc025ff5b0b8799d9045a581bceafd2e7d;hp=0fdf97ce59a3e0f982a7c247198c7a7671707c20;hpb=21fa9010ae6de8792f36cca08cb77aaa95d4b928;p=xonotic%2Fdarkplaces.git diff --git a/common.h b/common.h index 0fdf97ce..677219d6 100644 --- a/common.h +++ b/common.h @@ -281,14 +281,6 @@ qbool COM_StringDecolorize(const char *in, size_t size_in, char *out, size_t siz void COM_ToLowerString (const char *in, char *out, size_t size_out); void COM_ToUpperString (const char *in, char *out, size_t size_out); -// strlcat and strlcpy, from OpenBSD -// Most (all?) BSDs already have them -#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(MACOSX) -# define HAVE_STRLCAT 1 -# define HAVE_STRLCPY 1 -#endif - -#ifndef HAVE_STRLCAT /*! * Appends src to string dst of size dsize (unlike strncat, dsize is the * full size of dst, not space left). At most dsize-1 characters @@ -296,18 +288,14 @@ void COM_ToUpperString (const char *in, char *out, size_t size_out); * Returns strlen(src) + MIN(dsize, strlen(initial dst)). * If retval >= dsize, truncation occurred. */ -size_t strlcat(char *dst, const char *src, size_t dsize); -#endif // #ifndef HAVE_STRLCAT +size_t dp_strlcat(char *dst, const char *src, size_t dsize); -#ifndef HAVE_STRLCPY /*! * Copy string src to buffer dst of size dsize. At most dsize-1 * chars will be copied. Always NUL terminates (unless dsize == 0). * Returns strlen(src); if retval >= dsize, truncation occurred. */ -size_t strlcpy(char *dst, const char *src, size_t dsize); - -#endif // #ifndef HAVE_STRLCPY +size_t dp_strlcpy(char *dst, const char *src, size_t dsize); void FindFraction(double val, int *num, int *denom, int denomMax);