http://git.etherboot.org
/
people
/
xl0
/
gpxe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e8e4f8
)
move strndup back to string.c - used by strdup
author
Holger Lubitz
<hal@duncan.ol.sub.de>
Wed, 1 Aug 2007 23:47:31 +0000
(
01:47
+0200)
committer
Holger Lubitz
<hal@duncan.ol.sub.de>
Wed, 1 Aug 2007 23:47:31 +0000
(
01:47
+0200)
src/core/stringextra.c
patch
|
blob
|
history
diff --git
a/src/core/stringextra.c
b/src/core/stringextra.c
index
bd45ae8
..
c2be4fc
100644
(file)
--- a/
src/core/stringextra.c
+++ b/
src/core/stringextra.c
@@
-271,18
+271,3
@@
void * memscan(const void * addr, int c, size_t size)
return (void *) p;
}
#endif
-
-char * strndup(const char *s, size_t n)
-{
- size_t len = strlen(s);
- char *new;
-
- if (len>n)
- len = n;
- new = malloc(len+1);
- if (new) {
- new[len] = '\0';
- memcpy(new,s,len);
- }
- return new;
-}