GNOME Bugzilla – Bug 779923
g_mime_utils_header_decode_date returns negative number on error
Last modified: 2017-03-12 12:12:40 UTC
Created attachment 347733 [details] test program; in principle should print 0 The documentation claims that g_mime_utils_header_decode_date will return 0 on error, but this seems not always to be the case. In the attached sample program it returns a large negative number (on my machine -2209075200). Although it's not completely portable, on this machine a time_t is indeed a long int. I'm running Debian GNU/Linux on an amd64 machine, and the gmime version is 2.6.22-2
by the way (* 70 365 24 60 60) = 2209075200
(In reply to David Bremner from comment #1) > by the way (* 70 365 24 60 60) = 2209075200 oops, I read too quickly, It actually equals 2207520000 Maybe it's just a coincidence, but the returned value is just over 70 years before the epoch.
Fixed in the upcoming 3.0 (aka https://github.com/jstedfast/gmime master)