Skip to content

Commit

Permalink
Use sizeof() for buffer size where appropriate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Monin committed Apr 19, 2008
1 parent 3e04d15 commit 49f7e41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/md5-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui_fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 49f7e41

Please sign in to comment.