This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[patch] replace snprintf with g_snprintf
- From: Thomas Fitzsimmons <fitzsim at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Sat, 19 Feb 2005 15:33:34 -0500
- Subject: [patch] replace snprintf with g_snprintf
Hi,
This patch eliminates a gthread-jni.c compiler warning. OK for
mainline?
Tom
2005-02-19 Thomas Fitzsimmons <fitzsim@redhat.com>
* jni/gtk-peer/gthread-jni.c (throw): Call g_snprintf instead of
snprintf.
Index: jni/gtk-peer/gthread-jni.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gthread-jni.c,v
retrieving revision 1.7
diff -u -r1.7 gthread-jni.c
--- jni/gtk-peer/gthread-jni.c 2 Sep 2004 05:10:33 -0000 1.7
+++ jni/gtk-peer/gthread-jni.c 19 Feb 2005 17:15:01 -0000
@@ -223,8 +223,8 @@
#elif defined HAVE_INTTYPES_H
#include <inttypes.h>
#endif
-#include <stdio.h> /* snprintf */
#include <stdarg.h> /* va_list */
+#include <glib.h>
#include "gthread-jni.h"
#include <assert.h> /* assert() */
@@ -464,7 +464,7 @@
if ((buf = malloc (len)))
{
memset (buf, 0, len);
- snprintf (buf, len, fmt, message, file, line);
+ g_snprintf (buf, len, fmt, message, file, line);
jmessage = (*env)->NewStringUTF (env, buf);
free (buf);
}