Skip to content

Instantly share code, notes, and snippets.

@slyshykO
Last active March 14, 2018 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slyshykO/0a95037750e71d59070e06a2da25a0f3 to your computer and use it in GitHub Desktop.
Save slyshykO/0a95037750e71d59070e06a2da25a0f3 to your computer and use it in GitHub Desktop.
snprintf with zero ending
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