Use sizeof() for buffer size where appropriate.
authorLaurent Monin <geeqie@norz.org>
Sat, 19 Apr 2008 22:32:07 +0000 (22:32 +0000)
committerLaurent Monin <geeqie@norz.org>
Sat, 19 Apr 2008 22:32:07 +0000 (22:32 +0000)
src/md5-util.c
src/ui_fileops.c

index e214676..2f54a18 100644 (file)
@@ -349,7 +349,7 @@ gboolean md5_get_digest_from_file(const gchar *path, guchar digest[16])
 
        md5_init(&ctx);
        
-       while ((nb_bytes_read = fread (tmp_buf, sizeof (guchar), 1024, fp)) > 0)
+       while ((nb_bytes_read = fread (tmp_buf, sizeof (guchar), sizeof(tmp_buf), fp)) > 0)
                {
                md5_update (&ctx, tmp_buf, nb_bytes_read);
                }
index 8893758..25ddc4b 100644 (file)
@@ -425,7 +425,7 @@ gint copy_file(const gchar *s, const gchar *t)
 
        if (!fi || !fo) return FALSE;
 
-       while((b = fread(buf, sizeof(char), 4096, fi)) && b != 0)
+       while((b = fread(buf, sizeof(char), sizeof(buf), fi)) && b != 0)
                {
                if (fwrite(buf, sizeof(char), b, fo) != b)
                        {