mirror of https://github.com/ecmwf/eccodes.git
Examples: Correct arguments to perror
This commit is contained in:
parent
4752afb09e
commit
73a147286f
|
@ -68,7 +68,7 @@ int main(int argc, char* argv[])
|
|||
CODES_CHECK(codes_get_message(clone_handle, &buffer, &size), 0);
|
||||
/* write the buffer to a file */
|
||||
if (fwrite(buffer, 1, size, out) != size) {
|
||||
perror(argv[1]);
|
||||
perror(argv[2]);
|
||||
return 1;
|
||||
}
|
||||
codes_handle_delete(clone_handle);
|
||||
|
|
|
@ -116,7 +116,7 @@ int main(int argc, char** argv)
|
|||
|
||||
/* write the buffer in a file*/
|
||||
if (fwrite(buffer, 1, size, out) != size) {
|
||||
perror(argv[1]);
|
||||
perror(outfile);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ int main(int argc, char** argv)
|
|||
|
||||
/* write the buffer in a file*/
|
||||
if (fwrite(buffer, 1, size, out) != size) {
|
||||
perror(argv[1]);
|
||||
perror(outfile);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ int main(int argc, char** argv)
|
|||
|
||||
/* write the buffer in a file*/
|
||||
if (fwrite(buffer, 1, size, out) != size) {
|
||||
perror(argv[1]);
|
||||
perror(outfile);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ int main(int argc, char** argv)
|
|||
|
||||
/* write the buffer in a file*/
|
||||
if (fwrite(buffer, 1, size, out) != size) {
|
||||
perror(argv[1]);
|
||||
perror(outfile);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue