Skip to content

Instantly share code, notes, and snippets.

@sonOfRa
Created September 5, 2013 12:08
Show Gist options
  • Save sonOfRa/6449279 to your computer and use it in GitHub Desktop.
Save sonOfRa/6449279 to your computer and use it in GitHub Desktop.
/**
* 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