diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2008-06-06 02:07:05 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2008-06-06 02:07:05 +0000 |
commit | 62bf50ecad6384af66a943705db592e98a3c8492 (patch) | |
tree | ddadc7120d9f3b5d5c085d532d220f05b67f6db8 | |
parent | 8c7ec3389908808d0b572bc37e692f7b3d7ce0a4 (diff) |
removed the restriction that the template body over 8KB could not be read.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2007 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/template.c | 13 |
3 files changed, 15 insertions, 8 deletions
@@ -1,5 +1,10 @@ 2008-06-06 + * src/template.c: template_load(): removed the restriction that the + template body over 8KB could not be read. + +2008-06-06 + * INSTALL INSTALL.ja: fixed GnuPG/GPGME URL. * configure.in: require GPGME >= 1.0.0. diff --git a/ChangeLog.ja b/ChangeLog.ja index 5d77bfa4..fb687382 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2008-06-06 + * src/template.c: template_load(): 8KB を超えるテンプレート本文を + 読めない制限をなくした。 + +2008-06-06 + * INSTALL INSTALL.ja: GnuPG/GPGME の URL を修正。 * configure.in: GPGME >= 1.0.0 を要求するようにした。 diff --git a/src/template.c b/src/template.c index 1ade3d6f..074c6080 100644 --- a/src/template.c +++ b/src/template.c @@ -37,7 +37,6 @@ static Template *template_load(gchar *filename) Template *tmpl; FILE *fp; gchar buf[BUFFSIZE]; - gint bytes_read; if ((fp = g_fopen(filename, "rb")) == NULL) { FILE_OP_ERROR(filename, "fopen"); @@ -76,15 +75,13 @@ static Template *template_load(gchar *filename) return NULL; } - if ((bytes_read = fread(buf, 1, sizeof(buf), fp)) == 0) { - if (ferror(fp)) { - FILE_OP_ERROR(filename, "fread"); - template_free(tmpl); - return NULL; - } + tmpl->value = file_read_stream_to_str(fp); + if (!tmpl->value) { + g_warning("cannot read template body\n"); + template_free(tmpl); + return NULL; } fclose(fp); - tmpl->value = g_strndup(buf, bytes_read); return tmpl; } |