Patch: FYI: fastjar cleanup

Tom Tromey tromey@redhat.com
Mon Aug 27 16:09:00 GMT 2001


fastjar had an arbitrary size limitation.  I noticed this while
looking for something else.  I wrote a simple patch for it and I'm
checking it in on the trunk.

Tested on my x86 RH Linux 6.2 box.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* jartool.c (jarfile): Remove length limitation.
	(main): Use jt_strdup when initializing jarfile.

Index: jartool.c
===================================================================
RCS file: /cvs/gcc/gcc/fastjar/jartool.c,v
retrieving revision 1.6
diff -u -r1.6 jartool.c
--- jartool.c 2001/07/04 18:33:53 1.6
+++ jartool.c 2001/08/27 23:07:46
@@ -249,7 +249,7 @@
 int do_compress;
 int seekable;
 int verbose;
-char jarfile[256];
+char *jarfile;
 
 /* If non zero, then don't recurse in directory. Instead, add the
    directory entry and relie on an explicit list of files to populate
@@ -365,7 +365,7 @@
     if(i >= argc)
       usage(argv[0]);
 
-    strncpy(jarfile, argv[i++], 256);
+    jarfile = jt_strdup (argv[i++]);
   }
   if(manifest_file){
     if(i >= argc)
@@ -378,7 +378,7 @@
     if(i >= argc)
       usage(argv[0]);
 
-    strncpy(jarfile, argv[i++], 256);
+    jarfile = jt_strdup (argv[i++]);
   }
 
   /* create the jarfile */



More information about the Gcc-patches mailing list