aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/jvspec.c10
2 files changed, 7 insertions, 8 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index d6af9b3..43c5d49 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2001-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * jvspec.c (lang_specific_driver): Fix memory allocation
+ deficit, by using concat in lieu of xmalloc/sprintf.
+
2001-04-20 Per Bothner <per@bothner.com>
Fixes to compile multiple .class files at once.
diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c
index 105f813..fd6ec5a 100644
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
@@ -436,20 +436,14 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
if (strcmp (argv[i], "-classpath") == 0
|| strcmp (argv[i], "-CLASSPATH") == 0)
{
- char* patharg
- = (char*) xmalloc (strlen (argv[i]) + strlen (argv[i+1]) + 3);
- sprintf (patharg, "-f%s=%s", argv[i]+1, argv[i+1]);
- arglist[j] = patharg;
+ arglist[j] = concat ("-f", argv[i]+1, "=", argv[i+1], NULL);
i++;
continue;
}
if (strcmp (argv[i], "-d") == 0)
{
- char *patharg = (char *) xmalloc (sizeof ("-foutput-class-dir=")
- + strlen (argv[i + 1]) + 1);
- sprintf (patharg, "-foutput-class-dir=%s", argv[i + 1]);
- arglist[j] = patharg;
+ arglist[j] = concat ("-foutput-class-dir=", argv[i + 1], NULL);
++i;
continue;
}