summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2005-02-27 14:57:41 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2005-02-27 14:57:41 +0000
commitc7cc36234effd4e19024ab8a82445f3088ee9e48 (patch)
tree06a7346ecd339d9a65a37ae8483598e984d2a783
parentbc6e6f69c64bf3b30271b83636a4a4bf36747d2b (diff)
downloadATCD-c7cc36234effd4e19024ab8a82445f3088ee9e48.tar.gz
ChangeLogTag:Sun Feb 27 08:51:23 2005 Douglas C. Schmidt <schmidt@cs.wustl.edu>
-rw-r--r--ace/OS_NS_stdio.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/ace/OS_NS_stdio.cpp b/ace/OS_NS_stdio.cpp
index f28024f158e..2d15d2c05d3 100644
--- a/ace/OS_NS_stdio.cpp
+++ b/ace/OS_NS_stdio.cpp
@@ -327,6 +327,11 @@ ACE_OS::snprintf (wchar_t *buf, size_t maxlen, const wchar_t *format, ...)
// as a substitute, which does have the same signature as the UNIX98 one.
ACE_OSCALL (ACE_SPRINTF_ADAPTER (::_vsnwprintf (buf, maxlen, format, ap)),
int, -1, result);
+ // Win32 doesn't regard a full buffer with no 0-terminate as an
+ // overrun.
+ if (result == maxlen)
+ result = -1;
+
// Win32 doesn't 0-terminate the string if it overruns maxlen.
if (result == -1)
buf[maxlen-1] = '\0';