From 8d58643655b653c520fcdcc2a89b5067788f32fc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Dec 2009 10:33:07 +0100 Subject: MSVC build for chat example added --- examples/chat/prompt.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'examples') 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; -- cgit v1.2.3