MSVC build for chat example added

This commit is contained in:
unknown
2009-12-10 10:33:07 +01:00
parent 2e39f892c3
commit 8d58643655
4 changed files with 375 additions and 0 deletions

View File

@@ -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;