gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libextractor] 11/27: be more conservative about result fro


From: gnunet
Subject: [GNUnet-SVN] [libextractor] 11/27: be more conservative about result from ctime_r
Date: Sun, 15 Oct 2017 21:34:35 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository libextractor.

commit bb8184768d6b13bd32a3eb2224110f3e00573cbc
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Oct 15 20:17:32 2017 +0200

    be more conservative about result from ctime_r
---
 src/plugins/rpm_extractor.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/plugins/rpm_extractor.c b/src/plugins/rpm_extractor.c
index d54e3417..e1f2d621 100644
--- a/src/plugins/rpm_extractor.c
+++ b/src/plugins/rpm_extractor.c
@@ -352,8 +352,11 @@ EXTRACTOR_rpm_extract_method (struct 
EXTRACTOR_ExtractContext *ec)
                  uint32_t *v = rpmtdNextUint32 (p);
                  time_t tp = (time_t) *v;
 
-                 ctime_r (&tp, tmp);
-                 tmp[strlen (tmp) - 1] = '\0';   /* eat linefeed */
+                  if (NULL == ctime_r (&tp, tmp))
+                    break;
+                  if ( (strlen (tmp) > 0) &&
+                       (isblank ((unsigned char) tmp[strlen(tmp)-1])) )
+                    tmp[strlen (tmp) - 1] = '\0';   /* eat linefeed */
                  pthread_mutex_lock (&parg.lock);
                  if (0 != ec->proc (ec->cls,
                                     "rpm",

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]