Skip to content

Commit

Permalink
lasieve4e: initialize 'ret' to avoid undefined behavior
Browse files Browse the repository at this point in the history
gnfs-lasieve4e.c: In function ‘main’:
gnfs-lasieve4e.c:2987:11: warning: ‘ret’ may be used uninitialized in this function

if resume file is zero bytes, ret will be used uninitialized because
fgets will return NULL the first time it's called.  Intended behavior
is to continue without it, so start out with ret = 0.
  • Loading branch information
radii committed Apr 23, 2011
1 parent 4562af0 commit 3490572
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lasieve4/gnfs-lasieve4e.c
Original file line number Diff line number Diff line change
Expand Up @@ -2984,7 +2984,7 @@ int main(int argc, char **argv)

if (g_resume != 0) {
char buf[LINE_BUF_SIZE];
int ret;
int ret = 0;

if (zip_output != 0)
complain("Cannot resume gzipped file. gunzip, and retry without -z\n");
Expand Down

0 comments on commit 3490572

Please sign in to comment.