summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2015-07-30 23:45:28 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2015-07-30 23:45:30 +0200
commit258e58715f404964a8417b2235431f565ae295e2 (patch)
treea7146bf4d7df7d8ed2a4c10dde93c0a740eafee5
parent220d84e2a7eba253aabbe6e0362d76cc94502070 (diff)
downloadgcab-258e58715f404964a8417b2235431f565ae295e2.tar.gz
gcab-file: fix wrong file modification day
The day of the struct tm is not (0-30) but (1-31), no need to add +1! This fixes creation of cabinet file and MSI that Windows Installer rejects because of invalid date (29-02-2005 for ex). See bug: https://bugzilla.gnome.org/show_bug.cgi?id=753040
-rw-r--r--libgcab/gcab-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgcab/gcab-file.c b/libgcab/gcab-file.c
index d97539d..b55fbb5 100644
--- a/libgcab/gcab-file.c
+++ b/libgcab/gcab-file.c
@@ -142,7 +142,7 @@ gcab_file_update_info (GCabFile *self, GFileInfo *info)
self->cfile.usize = g_file_info_get_size (info);
self->cfile.fattr = GCAB_FILE_ATTRIBUTE_ARCH;
self->cfile.date = ((m->tm_year + 1900 - 1980 ) << 9 ) +
- ((m->tm_mon+1) << 5 ) + (m->tm_mday+1);
+ ((m->tm_mon+1) << 5 ) + (m->tm_mday);
self->cfile.time = (m->tm_hour << 11) + (m->tm_min << 5) + (m->tm_sec / 2);
return TRUE;