提交 a8b9c664 编写于 作者: J Jim Meyering

conftest: fix transposed size and count arguments to fwrite.

* tests/conftest.c: Include <string.h> and <errno.h>.
Also include strerror in diagnostic.


Author: Jim Meyering <meyering@redhat.com>
上级 92c8d7dd
Mon Nov 12 23:11:35 CET 2007 Jim Meyering <meyering@redhat.com>
conftest: fix transposed size and count arguments to fwrite.
* tests/conftest.c: Include <string.h> and <errno.h>.
Also include strerror in diagnostic.
Mon Nov 12 14:56:33 CET 2007 Daniel Veillard <veillard@redhat.com>
Begin fixing uses of strtol: parse integers more carefully.
......
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "conf.h"
int main(int argc, char **argv) {
......@@ -25,8 +27,8 @@ int main(int argc, char **argv) {
exit(3);
}
virConfFree(conf);
if (fwrite(buffer, len, 1, stdout) != len) {
fprintf(stderr, "Write failed\n");
if (fwrite(buffer, 1, len, stdout) != len) {
fprintf(stderr, "Write failed: %s\n", strerror (errno));
exit(1);
}
exit(0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册