/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_tracemse.c,v 1.18 2011/01/22 19:48:08 tom Exp $")
+MODULE_ID("$Id: lib_tracemse.c,v 1.20 2012/02/22 22:40:24 tom Exp $")
#ifdef TRACE
static char *
_trace_mmask_t(SCREEN *sp, mmask_t code)
{
-#define SHOW(m, s) if ((code & m) == m) strcat(strcat(my_buffer, s), ", ")
+#define SHOW(m, s) \
+ if ((code & m) == m) { \
+ _nc_STRCAT(my_buffer, s, sizeof(my_buffer)); \
+ _nc_STRCAT(my_buffer, ", ", sizeof(my_buffer)); \
+ }
SHOW(BUTTON1_RELEASED, "release-1");
SHOW(BUTTON1_PRESSED, "press-1");
NCURSES_EXPORT(char *)
_nc_tracemouse(SCREEN *sp, MEVENT const *ep)
{
- (void) sprintf(my_buffer, TRACEMSE_FMT,
- ep->id,
- ep->x,
- ep->y,
- ep->z,
- (unsigned long) ep->bstate);
+ _nc_SPRINTF(my_buffer, _nc_SLIMIT(sizeof(my_buffer))
+ TRACEMSE_FMT,
+ ep->id,
+ ep->x,
+ ep->y,
+ ep->z,
+ (unsigned long) ep->bstate);
(void) _trace_mmask_t(sp, ep->bstate);
- (void) strcat(my_buffer, "}");
+ _nc_STRCAT(my_buffer, "}", sizeof(my_buffer));
return (my_buffer);
}