Skip to content

Commit

Permalink
Fix missing check for fread() in combinatorX.c
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteube committed Oct 4, 2023
1 parent 881e38a commit 7865adc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/combinatorX.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,12 @@ static bool session_init (bool session, bool restore)
return false;
}
char buf[4] = { 0 };
fread (buf, 3, 1, main_ctx.sfp[0]);
int nread=fread (buf, 3, 1, main_ctx.sfp[0]);
if (nread != 3)
{
fprintf (stderr, "! fread() failed (%d): %s\n", errno, strerror (errno));
return false;
}
if (!strcmp(buf, "end"))
{
fprintf (stdout, "This session has already ended.\n");
Expand Down

0 comments on commit 7865adc

Please sign in to comment.