Last active
March 14, 2018 17:44
-
-
Save slyshykO/0a95037750e71d59070e06a2da25a0f3 to your computer and use it in GitHub Desktop.
snprintf with zero ending
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
template <uint32_t N, typename... Args> | |
void _snprintf(char (&buf)[N], const char* format, Args&&... args) | |
{ | |
snprintf(buf, N, format, args...); | |
buf[N-1] = '\0'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment