summaryrefslogtreecommitdiff
path: root/fastjar
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-03 21:40:47 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-03 21:40:47 +0000
commit55c44d2f28ed6ec0b33504abb2e9b3949847c069 (patch)
tree1c85b48a0648686d37557b5f352b747f5e06178e /fastjar
parent247978cdd7a69b4a9fcff5aad5ac835e0f13c1ac (diff)
downloadgcc-55c44d2f28ed6ec0b33504abb2e9b3949847c069.tar.gz
* jartool.c (jt_strdup): New function.
(get_next_arg): Use jt_strdup instead of strdup. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41815 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fastjar')
-rw-r--r--fastjar/ChangeLog5
-rw-r--r--fastjar/jartool.c23
2 files changed, 25 insertions, 3 deletions
diff --git a/fastjar/ChangeLog b/fastjar/ChangeLog
index d34f7d8c3aa..c8d4d2a8b11 100644
--- a/fastjar/ChangeLog
+++ b/fastjar/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-03 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * jartool.c (jt_strdup): New function.
+ (get_next_arg): Use jt_strdup instead of strdup.
+
2001-01-21 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
diff --git a/fastjar/jartool.c b/fastjar/jartool.c
index d8bfb2a86f3..b7193318d13 100644
--- a/fastjar/jartool.c
+++ b/fastjar/jartool.c
@@ -1,6 +1,6 @@
/*
jartool.c - main functions for fastjar utility
- Copyright (C) 1999, 2000 Bryan Burns
+ Copyright (C) 1999, 2000, 2001 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -17,9 +17,14 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/* $Id: jartool.c,v 1.3 2000/12/14 18:45:35 ghazi Exp $
+/* $Id: jartool.c,v 1.4 2000/12/28 21:47:37 robertl Exp $
$Log: jartool.c,v $
+ Revision 1.4 2000/12/28 21:47:37 robertl
+ 2000-12-28 Robert Lipe <robertl@sco.com>
+
+ * jartool.c (MAXPATHLEN): Provide if not defined.
+
Revision 1.3 2000/12/14 18:45:35 ghazi
Warning fixes:
@@ -218,6 +223,7 @@ int create_central_header(int);
int make_manifest(int, const char*);
static void init_args(char **, int);
static char *get_next_arg (void);
+static char *jt_strdup (char*);
/* global variables */
ub1 file_header[30];
@@ -531,7 +537,7 @@ get_next_arg ()
if (pos)
{
s [pos] = '\0';
- return strdup (s);
+ return jt_strdup (s);
}
else
return NULL;
@@ -1821,3 +1827,14 @@ Example 2: use an existing manifest file 'mymanifest' and archive all the\n\
exit(1);
}
+
+static char *
+jt_strdup(s)
+ char *s;
+{
+ char *result = (char*)malloc(strlen(s) + 1);
+ if (result == (char*)0)
+ return (char*)0;
+ strcpy(result, s);
+ return result;
+}