< prev index next >

src/share/vm/classfile/systemDictionary.cpp

Print this page
rev 10979 : 8140594: Various minor code improvements (compiler)

@@ -1158,14 +1158,14 @@
     char* index = strrchr(name, '/');
     *index = '\0'; // chop to just the package name
     while ((index = strchr(name, '/')) != NULL) {
       *index = '.'; // replace '/' with '.' in package name
     }
-    const char* fmt = "Prohibited package name: %s";
-    size_t len = strlen(fmt) + strlen(name);
+    const char* msg_text = "Prohibited package name: ";
+    size_t len = strlen(msg_text) + strlen(name) + 1;
     char* message = NEW_RESOURCE_ARRAY(char, len);
-    jio_snprintf(message, len, fmt, name);
+    jio_snprintf(message, len, "%s%s", msg_text, name);
     Exceptions::_throw_msg(THREAD_AND_LOCATION,
       vmSymbols::java_lang_SecurityException(), message);
   }
 
   if (!HAS_PENDING_EXCEPTION) {
< prev index next >