summaryrefslogtreecommitdiffstats
path: root/libjava/java
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-25 03:15:37 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-25 03:15:37 +0000
commit7a240ab7848a10b7be6726fd7ea256f6d496f3cb (patch)
treed01cd2bbc3694c3028c3a93f8fece9b50ba456fa /libjava/java
parentbdcfefe686cc9072523e636e0dfcfc7ffec391b3 (diff)
downloadppe42-gcc-7a240ab7848a10b7be6726fd7ea256f6d496f3cb.tar.gz
ppe42-gcc-7a240ab7848a10b7be6726fd7ea256f6d496f3cb.zip
2001-10-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Use snprintf, not asprintf. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46482 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r--libjava/java/lang/natClassLoader.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc
index d92a90c8b8c..b6dd8ce26ea 100644
--- a/libjava/java/lang/natClassLoader.cc
+++ b/libjava/java/lang/natClassLoader.cc
@@ -453,15 +453,14 @@ _Jv_RegisterClassHookDefault (jclass klass)
{
// If you get this, it means you have the same class in two
// different libraries.
- char *message;
- asprintf (&message, "Duplicate class registration: %s",
+ char message[200];
+ snprintf (&message[0], 200, "Duplicate class registration: %s",
klass->name->data);
if (! gcj::runtimeInitialized)
JvFail (message);
else
{
java::lang::String *str = JvNewStringLatin1 (message);
- free (message);
throw new java::lang::VirtualMachineError (str);
}
}
OpenPOWER on IntegriCloud