freebsd-nq/include/ntp_string.h
Cy Schubert b5e14a1344 Vendor import ntp 4.2.8.
Reviewed by:	roberto
Security:	VUXML: 4033d826-87dd-11e4-9079-3c970e169bc2
Security:	http://www.kb.cert.org/vuls/id/852879
Security:	CVE-2014-9293
Security	CVE-2014-9294
Security	CVE-2014-9295
Security	CVE-2014-9296
2014-12-20 22:52:39 +00:00

38 lines
708 B
C

/*
* Define string ops: strchr strrchr memcmp memmove memset
*/
#ifndef NTP_STRING_H
#define NTP_STRING_H
#ifdef HAVE_MEMORY_H
# include <memory.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_BSTRING_H
# include <bstring.h>
#endif
#ifdef NTP_NEED_BOPS
#ifdef HAVE_STRINGS_H
# include <strings.h> /* bcmp, bcopy, bzero */
#endif
void ntp_memset (char *, int, int);
#define memcmp(a, b, c) bcmp(a, b, (int)(c))
#define memmove(t, f, c) bcopy(f, t, (int)(c))
#define memcpy(t, f, c) bcopy(f, t, (int)(c))
#define memset(a, x, c) if (0 == (x)) \
bzero(a, (int)(c)); \
else \
ntp_memset((char *)(a), x, c)
#endif /* NTP_NEED_BOPS */
#endif /* NTP_STRING_H */