Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
7e4311a3
Commit
7e4311a3
authored
Jan 13, 1999
by
Kaveh R. Ghazi
Committed by
Kaveh Ghazi
Jan 13, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* xstrdup.c (xstrdup): Switch from strcpy to memcpy for speed.
From-SVN: r24651
parent
efd59a33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
libiberty/ChangeLog
+4
-0
libiberty/xstrdup.c
+10
-5
No files found.
libiberty/ChangeLog
View file @
7e4311a3
Wed Jan 13 14:16:36 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* xstrdup.c (xstrdup): Switch from strcpy to memcpy for speed.
Tue Dec 22 09:43:35 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* argv.c (buildargv): Cast the result of alloca in assignment.
...
...
libiberty/xstrdup.c
View file @
7e4311a3
...
...
@@ -2,16 +2,21 @@
This trivial function is in the public domain.
Ian Lance Taylor, Cygnus Support, December 1995. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "ansidecl.h"
#include "libiberty.h"
char
*
xstrdup
(
s
)
const
char
*
s
;
const
char
*
s
;
{
char
*
ret
;
ret
=
xmalloc
(
strlen
(
s
)
+
1
);
strcpy
(
ret
,
s
);
register
size_t
len
=
strlen
(
s
)
+
1
;
register
char
*
ret
=
xmalloc
(
len
);
memcpy
(
ret
,
s
,
len
);
return
ret
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment