GNOME Bugzilla – Bug 706405
buffer_get_time() should use time_t
Last modified: 2013-10-10 15:20:55 UTC
Created attachment 252434 [details] [review] make buffer_get_time() use time_t Hi. ctime and mtime are time_t values. However, buffer_get_time() takes glong as its last argument. This is problematic because depending on the operating system and arch, time_t can be different. For e.g. on OpenBSD it is both long long for 32-bit and 64-bit architectures while on Linux, it is long for 32-bit. This actually leads to a crash on my i386 machine running OpenBSD. I believe modifying buffer_get_time() to use time_t * as the last argument is the right way to go. gtk_secret_object_set_created() and gtk_secret_object_get_created() also take glong as its argument so there may still be some truncation on 32-bit systems -- not sure what to do about these. Opinion?
Any comment? It would be nice to have this fixed for 3.10 for OpenBSD users (I know it's a long shot but well...). Thanks.
Hi. I would appreciate if someone could have a look... thank you.
Thanks. Committed the patch. (In reply to comment #0) > gtk_secret_object_set_created() and gtk_secret_object_get_created() also > take glong as its argument so there may still be some truncation on > 32-bit systems -- not sure what to do about these. Seems like they should use time_t as well, right? Could you either reopen this bug or file a new one, when you have patch.