--- deliantra/server/socket/info.C 2008/08/29 02:07:10 1.51
+++ deliantra/server/socket/info.C 2009/10/15 21:09:32 1.53
@@ -5,18 +5,19 @@
* Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
* Copyright (©) 1992,2007 Frank Tore Johansen
*
- * Deliantra is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * Deliantra is free software: you can redistribute it and/or modify it under
+ * the terms of the Affero GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or (at your
+ * option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the Affero GNU General Public License
+ * and the GNU General Public License along with this program. If not, see
+ * .
*
* The authors can be reached via e-mail to
*/
@@ -179,14 +180,10 @@
void
new_draw_info_format (int flags, int pri, const object *pl, const char *format, ...)
{
- char buf[HUGE_BUF];
-
va_list ap;
va_start (ap, format);
- vsnprintf (buf, HUGE_BUF, format, ap);
+ new_draw_info (flags, pri, pl, vformat (format, ap));
va_end (ap);
-
- new_draw_info (flags, pri, pl, buf);
}
void
@@ -217,32 +214,26 @@
void
draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...)
{
- char buf[HUGE_BUF];
+ va_list ap;
+ va_start (ap, new_format);
- if (!pl || (pl->type != PLAYER) || (pl->contr == NULL))
+ if (!pl || !pl->is_player ())
return;
+ // TODO: just assume, and rip out?
if (!CLIENT_SUPPORT_READABLES (pl->contr->ns, type))
{
- va_list ap;
-
LOG (llevDebug, "Non supported extension text type for client.\n");
- va_start (ap, new_format);
- vsnprintf (buf, HUGE_BUF, old_format, ap);
- va_end (ap);
- new_draw_info (flags, pri, pl, buf);
- return;
+ new_draw_info (flags, pri, pl, vformat (old_format, ap));
}
else
{
- va_list ap;
-
- va_start (ap, new_format);
- vsnprintf (buf, HUGE_BUF, new_format, ap);
- va_end (ap);
+ char *buf = vformat (new_format, ap);
strip_media_tag (buf);
esrv_print_ext_msg (pl->contr->ns, flags & NDI_COLOR_MASK, type, subtype, buf);
}
+
+ va_end (ap);
}
/**