---
 src/log/logd/lgs_util.cc | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/log/logd/lgs_util.cc b/src/log/logd/lgs_util.cc
index 9b0707fd7..28b2a3271 100644
--- a/src/log/logd/lgs_util.cc
+++ b/src/log/logd/lgs_util.cc
@@ -199,19 +199,14 @@ char *lgs_get_time(time_t *time_in) {
   osafassert(timeStampData);
 
   stringSize = 5 * sizeof(char);
-  if (snprintf(srcString, (size_t)stringSize, "%d",
-           (timeStampData->tm_year + START_YEAR)) >=
-        static_cast<int>(stringSize)) {
-    LOG_WA("truncation on log year: %s", srcString);
-  }
+  snprintf(srcString, (size_t)stringSize, "%u",
+           (timeStampData->tm_year + START_YEAR));
 
   strncpy(timeStampString, srcString, stringSize);
 
   stringSize = 3 * sizeof(char);
-  if (snprintf(srcString, (size_t)stringSize, "%02d",
-               timeStampData->tm_mon + 1) >= static_cast<int>(stringSize)) {
-    LOG_WA("trunction on log month: %s", srcString);
-  }
+  snprintf(srcString, (size_t)stringSize, "%02u",
+               timeStampData->tm_mon + 1);
 
   strncat(timeStampString, srcString, stringSize);
 
-- 
2.17.2


-----------------------------------------------------------------------------------------------------------------------
Notice: This e-mail together with any attachments may contain information of 
Ribbon Communications Inc. that
is confidential and/or proprietary for the sole use of the intended recipient.  
Any review, disclosure, reliance or
distribution by others or forwarding without express permission is strictly 
prohibited.  If you are not the intended
recipient, please notify the sender immediately and then delete all copies, 
including any attachments.
-----------------------------------------------------------------------------------------------------------------------

_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to