Skip to content

Commit 29b27da

Browse files
authored
Merge pull request #1730 from NeoRaider/unix-strndup
unix: add strndup()
2 parents 4c07b66 + 3913f5c commit 29b27da

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)