Commit 0ee6e0a9 by John David Anglin Committed by John David Anglin

jartool.c (jt_strdup): New function.

	* jartool.c (jt_strdup): New function.
	(get_next_arg): Use jt_strdup instead of strdup.

From-SVN: r41815
parent c418c5ab
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> 2001-01-21 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt. * Makefile.in: Rebuilt.
......
/* /*
jartool.c - main functions for fastjar utility 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
...@@ -17,9 +17,14 @@ ...@@ -17,9 +17,14 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 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 $ $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 Revision 1.3 2000/12/14 18:45:35 ghazi
Warning fixes: Warning fixes:
...@@ -218,6 +223,7 @@ int create_central_header(int); ...@@ -218,6 +223,7 @@ int create_central_header(int);
int make_manifest(int, const char*); int make_manifest(int, const char*);
static void init_args(char **, int); static void init_args(char **, int);
static char *get_next_arg (void); static char *get_next_arg (void);
static char *jt_strdup (char*);
/* global variables */ /* global variables */
ub1 file_header[30]; ub1 file_header[30];
...@@ -531,7 +537,7 @@ get_next_arg () ...@@ -531,7 +537,7 @@ get_next_arg ()
if (pos) if (pos)
{ {
s [pos] = '\0'; s [pos] = '\0';
return strdup (s); return jt_strdup (s);
} }
else else
return NULL; return NULL;
...@@ -1821,3 +1827,14 @@ Example 2: use an existing manifest file 'mymanifest' and archive all the\n\ ...@@ -1821,3 +1827,14 @@ Example 2: use an existing manifest file 'mymanifest' and archive all the\n\
exit(1); 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment