projects
/
fio.git
/ blame
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blob
|
blame
(incremental) |
history
|
HEAD
eta: skip clearing of remainder of line when starting a new line
[fio.git]
/
oslib
/
strndup.c
Commit
Line
Data
b29c71c4
1
#include <stdlib.h>
df27f9ac
2
#include "strndup.h"
b29c71c4
JA
3
4
#ifndef CONFIG_HAVE_STRNDUP
5
6
char *strndup(const char *s, size_t n)
7
{
8
char *str = malloc(n + 1);
9
10
if (str) {
11
strncpy(str, s, n);
12
str[n] = '\0';
13
}
14
15
return str;
16
}
17
18
#endif