Commit 2b54b296 authored by Jon Griffiths's avatar Jon Griffiths

generator: Don't print variable unless the generator returned a value

clang warns that the generator assignment is conditional which could
lead to passing an undefined variable to printf.
Signed-off-by: default avatarJon Griffiths <jon_p_griffiths@yahoo.com>
parent 03f100b2
...@@ -16,7 +16,7 @@ int main(int argc, char *argv[]) ...@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
int val; int val;
#endif #endif
generator_next_val(val, g); if (generator_next_val(val, g))
printf("%d", val); printf("%d", val);
exit(0); exit(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment