Created
June 3, 2016 16:54
-
-
Save ldx/61416c9a9cc1f0bf147d10e7e6ef7954 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char *jsonp_strndup(const char *str, size_t len) | |
{ | |
char *new_str; | |
new_str = jsonp_malloc(len + 1); | |
if(!new_str) | |
return NULL; | |
memcpy(new_str, str, len); | |
new_str[len] = '\0'; | |
return new_str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment