Commit 11598139 by Bryce McKinlay Committed by Bryce McKinlay

natClassLoader.cc (_Jv_RegisterClassHookDefault): Use snprintf, not asprintf.

2001-10-25  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

	* java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Use
	snprintf, not asprintf.

From-SVN: r46482
parent cf521102
2001-10-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Use
snprintf, not asprintf.
2001-10-24 Loren J. Rittle <ljrittle@acm.org> 2001-10-24 Loren J. Rittle <ljrittle@acm.org>
* configure.in (case $THREADS): Add *-*-freebsd* configuration. * configure.in (case $THREADS): Add *-*-freebsd* configuration.
......
...@@ -453,15 +453,14 @@ _Jv_RegisterClassHookDefault (jclass klass) ...@@ -453,15 +453,14 @@ _Jv_RegisterClassHookDefault (jclass klass)
{ {
// If you get this, it means you have the same class in two // If you get this, it means you have the same class in two
// different libraries. // different libraries.
char *message; char message[200];
asprintf (&message, "Duplicate class registration: %s", snprintf (&message[0], 200, "Duplicate class registration: %s",
klass->name->data); klass->name->data);
if (! gcj::runtimeInitialized) if (! gcj::runtimeInitialized)
JvFail (message); JvFail (message);
else else
{ {
java::lang::String *str = JvNewStringLatin1 (message); java::lang::String *str = JvNewStringLatin1 (message);
free (message);
throw new java::lang::VirtualMachineError (str); throw new java::lang::VirtualMachineError (str);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment