Commit d447b22b authored by gsell's avatar gsell
Browse files

Merge branch '388-fixes-for-gcc-9-2-warning' into 'master'

Resolve "fixes for gcc 9.2 warning"

Closes #388

See merge request !200
parents edc94273 78673bda
......@@ -50,7 +50,7 @@ int main(int argc, char* argv[])
/* other variables */
int state = -1;
char statefile[FILE_NAME_LENGTH];
char *statefile;
int result;
/* reading command line parameters */
......@@ -61,7 +61,7 @@ int main(int argc, char* argv[])
sscanf(argv[3], "%lf", &poll);
/* generate name of statefile */
sprintf(statefile, "%ssta", filenamebase);
asprintf(&statefile, "%ssta", filenamebase);
/* main loop */
while (state != 6) /* stop state for selector */
......
......@@ -94,7 +94,7 @@ void write_pop(char* filename, pop* pp, int size)
int i;
FILE *fp;
assert(0 <= size <= pp->size);
assert(0 <= size && size <= pp->size);
fp = fopen(filename, "w");
assert(fp != NULL);
......@@ -129,4 +129,4 @@ int check_file(char* filename)
return (0); /* file is ready for writing */
else
return (1); /* file is not ready for writing */
}
\ No newline at end of file
}
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