cpp: Fix an OpenBSD compilation error that appears to be a real bug
authorDavid Reiss <dreiss@apache.org>
Thu, 21 May 2009 02:28:14 +0000 (02:28 +0000)
committerDavid Reiss <dreiss@apache.org>
Thu, 21 May 2009 02:28:14 +0000 (02:28 +0000)
The (Linux) man page for ctime_r states pretty clearly that
the buffer it uses must have space for at least 26 characters.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@776925 13f79535-47bb-0310-9956-ffa450edef68

lib/cpp/src/Thrift.h

index 26d2b0f..e077923 100644 (file)
@@ -65,7 +65,7 @@ class TOutput {
 
   inline static void errorTimeWrapper(const char* msg) {
     time_t now;
-    char dbgtime[25];
+    char dbgtime[26];
     time(&now);
     ctime_r(&now, dbgtime);
     dbgtime[24] = 0;