diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-10-15 20:17:32 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-10-15 20:17:32 +0200 |
commit | bb8184768d6b13bd32a3eb2224110f3e00573cbc (patch) | |
tree | f15bea33b7c4169b7858d7c47bb6ba8524f6b56f /src/plugins/rpm_extractor.c | |
parent | e0fba0ff1664c1762bd3367f1136ca3f9c9052f2 (diff) | |
download | libextractor-bb8184768d6b13bd32a3eb2224110f3e00573cbc.tar.gz libextractor-bb8184768d6b13bd32a3eb2224110f3e00573cbc.zip |
be more conservative about result from ctime_r
Diffstat (limited to 'src/plugins/rpm_extractor.c')
-rw-r--r-- | src/plugins/rpm_extractor.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/rpm_extractor.c b/src/plugins/rpm_extractor.c index d54e341..e1f2d62 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) | |||
352 | uint32_t *v = rpmtdNextUint32 (p); | 352 | uint32_t *v = rpmtdNextUint32 (p); |
353 | time_t tp = (time_t) *v; | 353 | time_t tp = (time_t) *v; |
354 | 354 | ||
355 | ctime_r (&tp, tmp); | 355 | if (NULL == ctime_r (&tp, tmp)) |
356 | tmp[strlen (tmp) - 1] = '\0'; /* eat linefeed */ | 356 | break; |
357 | if ( (strlen (tmp) > 0) && | ||
358 | (isblank ((unsigned char) tmp[strlen(tmp)-1])) ) | ||
359 | tmp[strlen (tmp) - 1] = '\0'; /* eat linefeed */ | ||
357 | pthread_mutex_lock (&parg.lock); | 360 | pthread_mutex_lock (&parg.lock); |
358 | if (0 != ec->proc (ec->cls, | 361 | if (0 != ec->proc (ec->cls, |
359 | "rpm", | 362 | "rpm", |