diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-11-14 08:07:48 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-11-14 08:07:48 +0000 |
commit | f2493d0c45b0e2c12795a1f12ccd92f6f347f2f5 (patch) | |
tree | 1b038cee483805c7cdd8a2981e8809c6ece12834 | |
parent | 88add95ac772a31df8d315292ac5b173ebc094b6 (diff) |
prevent integer overflow on summary status.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@742 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.ja | 6 | ||||
-rw-r--r-- | libsylph/utils.c | 2 | ||||
-rw-r--r-- | libsylph/utils.h | 2 | ||||
-rw-r--r-- | src/summaryview.c | 2 | ||||
-rw-r--r-- | src/summaryview.h | 8 |
6 files changed, 19 insertions, 7 deletions
@@ -1,5 +1,11 @@ 2005-11-14 + * libsylph/utils.[ch] + src/summaryview.[ch]: use gint64 for total_size to avoid overflow + on environments where sizeof(off_t) is 4. + +2005-11-14 + * src/textview.c: changed the shadow type to GTK_SHADOW_ETCHED_IN. * src/summaryview.[ch] src/mainwindow.c: added separator between the summary status and diff --git a/ChangeLog.ja b/ChangeLog.ja index 67846299..c04c09da 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,11 @@ 2005-11-14 + * libsylph/utils.[ch] + src/summaryview.[ch]: sizeof(off_t) が 4 の環境でのオーバーフローを + 防ぐため total_size に gint64 を使用。 + +2005-11-14 + * src/textview.c: shadow type を GTK_SHADOW_ETCHED_IN に変更。 * src/summaryview.[ch] src/mainwindow.c: サマリステータスとヘッダペインの間にセパレータを diff --git a/libsylph/utils.c b/libsylph/utils.c index 18612eaa..0cb484f0 100644 --- a/libsylph/utils.c +++ b/libsylph/utils.c @@ -267,7 +267,7 @@ gchar *itos(gint n) return itos_buf(nstr, n); } -gchar *to_human_readable(off_t size) +gchar *to_human_readable(gint64 size) { static gchar str[10]; diff --git a/libsylph/utils.h b/libsylph/utils.h index 8ef85896..b5cb3a76 100644 --- a/libsylph/utils.h +++ b/libsylph/utils.h @@ -213,7 +213,7 @@ gint to_number (const gchar *nstr); gchar *itos_buf (gchar *nstr, gint n); gchar *itos (gint n); -gchar *to_human_readable (off_t size); +gchar *to_human_readable (gint64 size); /* alternative string functions */ gint strcmp2 (const gchar *s1, diff --git a/src/summaryview.c b/src/summaryview.c index 8f6743e3..96dbaa88 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -1646,7 +1646,7 @@ static void summary_update_status(SummaryView *summaryview) GtkTreeIter iter; gboolean valid; MsgInfo *msginfo; - off_t total_size = 0; + gint64 total_size = 0; gint deleted = 0, moved = 0, copied = 0; valid = gtk_tree_model_get_iter_first(model, &iter); diff --git a/src/summaryview.h b/src/summaryview.h index 3742f793..8137f6ef 100644 --- a/src/summaryview.h +++ b/src/summaryview.h @@ -105,10 +105,10 @@ struct _SummaryView FolderItem *folder_item; /* current message status */ - off_t total_size; - gint deleted; - gint moved; - gint copied; + gint64 total_size; + gint deleted; + gint moved; + gint copied; /* private: |