Annotation of pkgsrc/net/gift/patches/patch-src_plugin.c, Revision 1.1
1.1 ! he 1: $NetBSD$
! 2:
! 3: Don't confuse the C preprocessor by supplying what looks
! 4: like a single argument into two arguments. (Confuses SSP macros.)
! 5:
! 6: --- src/plugin.c.orig 2004-11-12 02:52:16.000000000 +0000
! 7: +++ src/plugin.c
! 8: @@ -123,16 +123,18 @@ static void *dummy_voidptr_null (/*< voi
! 9: * This is just terrible. Please make me fix this.
! 10: */
! 11: #define APPENDMSG msg + msgwr, sizeof (msg) - msgwr - 1
! 12: +#define MSGPTR msg + msgwr
! 13: +#define REMAIN sizeof(msg) - msgwr - 1
! 14: #define LOGMSG(fmt,pfx1,pfx2) \
! 15: char msg[4096]; \
! 16: size_t msgwr = 0; \
! 17: va_list args; \
! 18: if (pfx1) \
! 19: - msgwr += snprintf (APPENDMSG, "%s: ", STRING_NOTNULL(pfx1)); \
! 20: + msgwr += snprintf (MSGPTR, REMAIN, "%s: ", STRING_NOTNULL(pfx1)); \
! 21: if (pfx2) \
! 22: - msgwr += snprintf (APPENDMSG, "[%s]: ", STRING_NOTNULL(pfx2)); \
! 23: + msgwr += snprintf (MSGPTR, REMAIN, "[%s]: ", STRING_NOTNULL(pfx2)); \
! 24: va_start (args, fmt); \
! 25: - vsnprintf (APPENDMSG, fmt, args); \
! 26: + vsnprintf (MSGPTR, REMAIN, fmt, args); \
! 27: va_end (args);
! 28:
! 29: static int wrapper_dbg (Protocol *p, char *fmt, ...)
CVSweb <webmaster@jp.NetBSD.org>