bugfix
authorPekka Riikonen <priikone@silcnet.org>
Tue, 10 Oct 2000 07:26:32 +0000 (07:26 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 10 Oct 2000 07:26:32 +0000 (07:26 +0000)
apps/silcd/server.c

index 1f8ab56cd569366904db7a77bd96334f9c033125..07a071dd6522cd8c9160c03586c48f807273944b 100644 (file)
@@ -2782,9 +2782,12 @@ void silc_server_send_notify_dest(SilcServer server,
                                  const char *fmt, ...)
 {
   va_list ap;
+  char *cp;
   unsigned char buf[4096];
   SilcBuffer packet;
 
+  cp = (char *)fmt;
+
   if (argc)
     va_start(ap, fmt);
 
@@ -2793,9 +2796,10 @@ void silc_server_send_notify_dest(SilcServer server,
     vsprintf(buf, fmt, ap);
     va_end(ap);
     argc = 0;
+    cp = buf;
   }
 
-  packet = silc_notify_payload_encode(type, (char *)fmt, argc, ap);
+  packet = silc_notify_payload_encode(type, cp, argc, ap);
   silc_server_packet_send_dest(server, sock, SILC_PACKET_NOTIFY, 0, 
                               dest_id, dest_id_type,
                               packet->data, packet->len, FALSE);
@@ -2813,9 +2817,12 @@ void silc_server_send_notify_to_channel(SilcServer server,
                                        const char *fmt, ...)
 {
   va_list ap;
+  char *cp;
   unsigned char buf[4096];
   SilcBuffer packet;
 
+  cp = (char *)fmt;
+
   if (argc)
     va_start(ap, fmt);
 
@@ -2824,9 +2831,10 @@ void silc_server_send_notify_to_channel(SilcServer server,
     vsprintf(buf, fmt, ap);
     va_end(ap);
     argc = 0;
+    cp = buf;
   }
 
-  packet = silc_notify_payload_encode(type, (char *)fmt, argc, ap);
+  packet = silc_notify_payload_encode(type, cp, argc, ap);
   silc_server_packet_send_to_channel(server, channel, 
                                     SILC_PACKET_NOTIFY,
                                     packet->data, packet->len, FALSE);