Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Augeas: Fix return type of fread call
Browse files Browse the repository at this point in the history
  • Loading branch information
sanssecours committed Dec 11, 2019
1 parent 584f1ba commit 1caadd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/augeas/augeas.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ static char * loadFile (FILE * fh)
{
content = elektraMalloc ((size_t) fileSize * sizeof (char) + 1);
if (content == 0) return 0;
int readBytes = (int) fread (content, sizeof (char), (size_t) fileSize, fh);
size_t readBytes = fread (content, sizeof (char), (size_t) fileSize, fh);

if (feof (fh) || ferror (fh) || readBytes != fileSize) return 0;
if (feof (fh) || ferror (fh) || readBytes != (size_t) fileSize) return 0;

/* null terminate the string, as fread doesn't do it */
content[fileSize] = 0;
Expand Down

0 comments on commit 1caadd5

Please sign in to comment.