summaryrefslogtreecommitdiff
path: root/src/snprintf.c
diff options
context:
space:
mode:
authorDaniel Richard G <skunk@iSKUNK.ORG>2013-10-29 16:41:48 -0400
committerDaniel Richard G <skunk@iSKUNK.ORG>2013-10-29 16:41:48 -0400
commitf3c6a97c8a9ac8f95d91ccfe4d3c83d1bd04b349 (patch)
treed680f07081c146b0f9568d2750b30982ca9aa818 /src/snprintf.c
parenta100fe192589ac89f9669795e1592c4a5e296a88 (diff)
downloadraptor-f3c6a97c8a9ac8f95d91ccfe4d3c83d1bd04b349.tar.gz
Tru64 V4.0G compatibility fixes
Diffstat (limited to 'src/snprintf.c')
-rw-r--r--src/snprintf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/snprintf.c b/src/snprintf.c
index 03cf8781..922ebf99 100644
--- a/src/snprintf.c
+++ b/src/snprintf.c
@@ -107,9 +107,12 @@ vsnprintf_is_c99(void)
* with an unterminated string. The added check makes sure \
* the string returned is terminated - otherwise more buffer \
* space is allocated and the while() loop retries. \
+ * \
+ * On tru64, vsnprintf() returns the buffer size minus 1 if \
+ * the buffer is too small, leaving room for the terminator. \
*/ \
if((len >= 0) && \
- (RAPTOR_GOOD_CAST(size_t, len) < size) && \
+ (RAPTOR_GOOD_CAST(size_t, len) + 1 < size) && \
(tmp_buffer[len] == '\0')) { \
len = RAPTOR_BAD_CAST(int, strlen(tmp_buffer)); \
RAPTOR_FREE(char*, tmp_buffer); \