re PR libgcj/5064 (java/lang/natClassLoader.cc doesn't compile on systems without snprintf)
Fix for PR libgcj/5064. * java/lang/natClassLoader.cc: Don't include stdio.h. (_Jv_RegisterClassHookDefault): Don't use snprintf. From-SVN: r47861
This commit is contained in:
parent
3afdfae81c
commit
d12a187337
@ -1,3 +1,9 @@
|
||||
2001-12-10 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
Fix for PR libgcj/5064.
|
||||
* java/lang/natClassLoader.cc: Don't include stdio.h.
|
||||
(_Jv_RegisterClassHookDefault): Don't use snprintf.
|
||||
|
||||
2001-12-09 Per Bothner <per@bothner.com>
|
||||
|
||||
* gnu/gcj/xlib/XImage.java (toString): Add missing initialization.
|
||||
|
@ -14,7 +14,6 @@ details. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gcj/cni.h>
|
||||
#include <jvm.h>
|
||||
@ -463,9 +462,13 @@ _Jv_RegisterClassHookDefault (jclass klass)
|
||||
{
|
||||
// If you get this, it means you have the same class in two
|
||||
// different libraries.
|
||||
#define TEXT "Duplicate class registration: "
|
||||
// We size-limit MESSAGE so that you can't trash the stack.
|
||||
char message[200];
|
||||
snprintf (&message[0], 200, "Duplicate class registration: %s",
|
||||
klass->name->data);
|
||||
strcpy (message, TEXT);
|
||||
strncpy (message + sizeof (TEXT) - 1, klass->name->data,
|
||||
sizeof (message) - sizeof (TEXT));
|
||||
message[sizeof (message) - 1] = '\0';
|
||||
if (! gcj::runtimeInitialized)
|
||||
JvFail (message);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user