Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
181d1906
Commit
181d1906
authored
Feb 10, 2014
by
Damien George
Browse files
stm: Remove unused, useless and not-to-be-used strndup.
Addresses issue #275.
parent
f1081f40
Changes
3
Hide whitespace changes
Inline
Side-by-side
stm/std.h
View file @
181d1906
...
...
@@ -13,7 +13,6 @@ void *memset(void *s, int c, size_t n);
size_t
strlen
(
const
char
*
str
);
int
strcmp
(
const
char
*
s1
,
const
char
*
s2
);
int
strncmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
);
char
*
strndup
(
const
char
*
s
,
size_t
n
);
char
*
strcpy
(
char
*
dest
,
const
char
*
src
);
char
*
strcat
(
char
*
dest
,
const
char
*
src
);
char
*
strchr
(
const
char
*
s
,
int
c
);
...
...
stm/string0.c
View file @
181d1906
...
...
@@ -78,17 +78,6 @@ int strncmp(const char *s1, const char *s2, size_t n) {
else
return
0
;
}
char
*
strndup
(
const
char
*
s
,
size_t
n
)
{
size_t
len
=
strlen
(
s
);
if
(
n
>
len
)
{
n
=
len
;
}
char
*
s2
=
malloc
(
n
+
1
);
memcpy
(
s2
,
s
,
n
);
s2
[
n
]
=
'\0'
;
return
s2
;
}
char
*
strcpy
(
char
*
dest
,
const
char
*
src
)
{
char
*
d
=
dest
;
while
(
*
src
)
{
...
...
teensy/std.h
View file @
181d1906
...
...
@@ -13,7 +13,6 @@ void *memset(void *s, int c, size_t n);
int
strlen
(
const
char
*
str
);
int
strcmp
(
const
char
*
s1
,
const
char
*
s2
);
int
strncmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
);
char
*
strndup
(
const
char
*
s
,
size_t
n
);
char
*
strcpy
(
char
*
dest
,
const
char
*
src
);
char
*
strcat
(
char
*
dest
,
const
char
*
src
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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