diff --git a/libjava/ChangeLog b/libjava/ChangeLog index cd51b38bbc3..a01c02ebb35 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2001-10-25 Bryce McKinlay + + * java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Use + snprintf, not asprintf. + 2001-10-24 Loren J. Rittle * configure.in (case $THREADS): Add *-*-freebsd* configuration. 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); } }