Skip to content

Commit 3913f5c

Browse files
committed
unix: add strndup()
Add strndup(), as specified by POSIX.1-2008.
1 parent 4c07b66 commit 3913f5c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/unix/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ extern "C" {
525525
pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
526526
pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
527527
pub fn strdup(cs: *const c_char) -> *mut c_char;
528+
pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char;
528529
pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
529530
pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
530531
pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;

0 commit comments

Comments
 (0)