Avoid improper reuse of a va_list.
[ircu2.10.12-pk.git] / ircd / ircd_reply.c
index d5641bec321049be60129b47ca01d7fc61d69dd1..256d18c5047c92f2ad5521eabca98ecce2f3b6f0 100644 (file)
 int protocol_violation(struct Client* cptr, const char* pattern, ...)
 {
   struct VarData vd;
+  char message[BUFSIZE];
 
   assert(pattern);
   assert(cptr);
 
   vd.vd_format = pattern;
   va_start(vd.vd_args, pattern);
-
-  sendwallto_group_butone(&me, WALL_DESYNCH, NULL,
-                       "Protocol Violation from %s: %v", cli_name(cptr), &vd);
-
+  ircd_snprintf(NULL, message, sizeof(message),
+                "Protocol Violation from %s: %v", cli_name(cptr), &vd);
   va_end(vd.vd_args);
+
+  sendwallto_group_butone(&me, WALL_DESYNCH, NULL, "%s", message);
   return 0;
 }