[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch] small "fix" to src/fe-gtk/about.c
[Please CC me on any discussion as I'm not subscribed to the list]
Hi,
In src/fe-gtk/about.c, there are a couple of calls to snprintf()
with #ifdefs sprinkled in the arguments. Unfortunately, when C
functions are redefined as macros, #ifdefs are not expanded in macro
argument lists and this causes a compilation error (note that its
legal for C library functions to be redefined as macros). This is
not a hypothetical situation, as tools like Immunix's Formatguard
<http://www.immunix.org/formatguard.html> and libsafe tend to redefine
the C string handling functions.
Attached is a patch against 1.8.9 (it's still prevalent in the 1.9.1
tarball) that prevents the C preprocessor from treating the snprintf
call as a macro.
Thanks for writing Xchat!
--
Steve Beattie Don't trust programmers?
<steve@wirex.net> Complete StackGuard distro at
http://NxNW.org/~steve/ immunix.org
http://www.personaltelco.net -- overthrowing QWest, one block at a time.
--- xchat-1.8.9.orig/src/fe-gtk/about.c Tue May 7 20:30:53 2002
+++ xchat-1.8.9/src/fe-gtk/about.c Thu Jun 13 14:30:45 2002
@@ -38,7 +38,7 @@
char buf[512];
const gchar *author[] = { "Peter Zelezny <zed@xchat.org>", 0 };
- snprintf (buf, sizeof (buf),
+ (snprintf) (buf, sizeof (buf),
_("An IRC Client for UNIX.\n\n"
"This binary was compiled on "__DATE__"\n"
"Using GTK %d.%d.%d X %d\n"
@@ -110,7 +110,7 @@
gtk_style_unref (head_style);
gtk_container_add (GTK_CONTAINER (vbox), label);
- snprintf (buf, sizeof (buf),
+ (snprintf) (buf, sizeof (buf),
_("(C) 1998-2001 Peter Zelezny <zed@xchat.org>\n\n"
"An IRC Client for UNIX.\n\n"
"This binary was compiled on "__DATE__"\n"
PGP signature