Created
September 5, 2013 12:08
-
-
Save sonOfRa/6449279 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
/** | |
* Null-terminate the given string. Length is the length of the original string, | |
* out must be allocated with a size of at least length+1 | |
*/ | |
void nullterminate(uint8_t *in, uint16_t length, char *out) { | |
memcpy(out, in, length); | |
out[length] = '\0'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment