diff options
author | unknown <bundra@.(none)> | 2009-12-10 10:33:07 +0100 |
---|---|---|
committer | unknown <bundra@.(none)> | 2009-12-10 10:33:07 +0100 |
commit | 8d58643655b653c520fcdcc2a89b5067788f32fc (patch) | |
tree | 0d6dfd0c1c37d06d346d967f32b544eddca97f39 /examples | |
parent | 2e39f892c353851fe90261db0a0875abab50539f (diff) |
MSVC build for chat example added
Diffstat (limited to 'examples')
-rw-r--r-- | examples/chat/prompt.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/chat/prompt.cpp b/examples/chat/prompt.cpp index 6132d63..72b0195 100644 --- a/examples/chat/prompt.cpp +++ b/examples/chat/prompt.cpp @@ -42,7 +42,12 @@ int main (int argc, const char *argv []) // Prepare a message buffer. Place username at the beginning // of the message. char textbuf [1024]; +#ifdef _MSC_VER + _snprintf_s (textbuf, sizeof (textbuf), sizeof (textbuf), "%s: ", + username); +#else snprintf (textbuf, sizeof (textbuf), "%s: ", username); +#endif size_t prefixsz = strlen (textbuf); char *text = textbuf + prefixsz; |