projects
/
platform
/
upstream
/
binutils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gold depend on opcodes
[platform/upstream/binutils.git]
/
libiberty
/
xstrndup.c
diff --git
a/libiberty/xstrndup.c
b/libiberty/xstrndup.c
index
b481e4a
..
0a41f60
100644
(file)
--- a/
libiberty/xstrndup.c
+++ b/
libiberty/xstrndup.c
@@
-15,8
+15,8
@@
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with libiberty; see the file COPYING.LIB. If
You should have received a copy of the GNU Library General Public
License along with libiberty; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 5
9 Temple Place - Suite 330
,
-Boston, MA 0211
1-1307
, USA. */
+not, write to the Free Software Foundation, Inc., 5
1 Franklin Street - Fifth Floor
,
+Boston, MA 0211
0-1301
, USA. */
/*
/*
@@
-45,9
+45,7
@@
always NUL terminated.
#include "libiberty.h"
char *
#include "libiberty.h"
char *
-xstrndup (s, n)
- const char *s;
- size_t n;
+xstrndup (const char *s, size_t n)
{
char *result;
size_t len = strlen (s);
{
char *result;
size_t len = strlen (s);
@@
-55,8
+53,8
@@
xstrndup (s, n)
if (n < len)
len = n;
if (n < len)
len = n;
- result =
xmalloc (
len + 1);
+ result =
XNEWVEC (char,
len + 1);
result[len] = '\0';
result[len] = '\0';
- return memcpy (result, s, len);
+ return
(char *)
memcpy (result, s, len);
}
}