summaryrefslogtreecommitdiff
path: root/examples/chat
diff options
context:
space:
mode:
authorunknown <bundra@.(none)>2009-12-10 10:33:07 +0100
committerunknown <bundra@.(none)>2009-12-10 10:33:07 +0100
commit8d58643655b653c520fcdcc2a89b5067788f32fc (patch)
tree0d6dfd0c1c37d06d346d967f32b544eddca97f39 /examples/chat
parent2e39f892c353851fe90261db0a0875abab50539f (diff)
MSVC build for chat example added
Diffstat (limited to 'examples/chat')
-rw-r--r--examples/chat/prompt.cpp5
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;