aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-11-02 09:26:54 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-11-02 09:26:54 +0000
commit243e6b84eb31ffd7d1def387ad2c2ec471049aaa (patch)
treef69b065208f537920cb7634c96b4f9ac77896b32 /libsylph
parente667a6f3d8c6514878e184b1c8541cb5f31083d8 (diff)
more fix for UID more than INT_MAX.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2327 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/mh.c4
-rw-r--r--libsylph/news.c2
-rw-r--r--libsylph/procmsg.c2
-rw-r--r--libsylph/utils.c6
-rw-r--r--libsylph/utils.h2
5 files changed, 12 insertions, 4 deletions
diff --git a/libsylph/mh.c b/libsylph/mh.c
index 71eb2a26..e86b5671 100644
--- a/libsylph/mh.c
+++ b/libsylph/mh.c
@@ -365,7 +365,7 @@ static gchar *mh_fetch_msg(Folder *folder, FolderItem *item, gint num)
return NULL;
path = folder_item_get_path(item);
- file = g_strconcat(path, G_DIR_SEPARATOR_S, itos_buf(buf, num), NULL);
+ file = g_strconcat(path, G_DIR_SEPARATOR_S, utos_buf(buf, num), NULL);
g_free(path);
if (!is_file_exist(file)) {
g_free(file);
@@ -933,7 +933,7 @@ static gboolean mh_is_msg_changed(Folder *folder, FolderItem *item,
struct stat s;
gchar buf[16];
- if (g_stat(itos_buf(buf, msginfo->msgnum), &s) < 0 ||
+ if (g_stat(utos_buf(buf, msginfo->msgnum), &s) < 0 ||
msginfo->size != s.st_size ||
msginfo->mtime != s.st_mtime)
return TRUE;
diff --git a/libsylph/news.c b/libsylph/news.c
index 69dc0c29..55cd7c0d 100644
--- a/libsylph/news.c
+++ b/libsylph/news.c
@@ -380,7 +380,7 @@ static gchar *news_fetch_msg(Folder *folder, FolderItem *item, gint num)
path = folder_item_get_path(item);
if (!is_dir_exist(path))
make_dir_hier(path);
- filename = g_strconcat(path, G_DIR_SEPARATOR_S, itos_buf(nstr, num),
+ filename = g_strconcat(path, G_DIR_SEPARATOR_S, utos_buf(nstr, num),
NULL);
g_free(path);
diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c
index 3dde7a0e..d9dacd6d 100644
--- a/libsylph/procmsg.c
+++ b/libsylph/procmsg.c
@@ -1312,7 +1312,7 @@ gchar *procmsg_get_message_file_path(MsgInfo *msginfo)
gchar nstr[16];
path = folder_item_get_path(msginfo->folder);
file = g_strconcat(path, G_DIR_SEPARATOR_S,
- itos_buf(nstr, msginfo->msgnum), NULL);
+ utos_buf(nstr, msginfo->msgnum), NULL);
g_free(path);
}
diff --git a/libsylph/utils.c b/libsylph/utils.c
index f2b2481b..2aae90d0 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -330,6 +330,12 @@ gchar *itos(gint n)
return itos_buf(nstr, n);
}
+gchar *utos_buf(gchar *nstr, guint n)
+{
+ g_snprintf(nstr, 11, "%u", n);
+ return nstr;
+}
+
gchar *to_human_readable(gint64 size)
{
static gchar str[16];
diff --git a/libsylph/utils.h b/libsylph/utils.h
index c43f690f..616a87e0 100644
--- a/libsylph/utils.h
+++ b/libsylph/utils.h
@@ -222,6 +222,8 @@ gint to_number (const gchar *nstr);
gchar *itos_buf (gchar *nstr,
gint n);
gchar *itos (gint n);
+gchar *utos_buf (gchar *nstr,
+ guint n);
gchar *to_human_readable (gint64 size);
/* alternative string functions */