scripts: confdata: Fix fwrite warning
diff mbox

Message ID 1275489859-31874-1-git-send-email-weber@corscience.de
State New, archived
Headers show

Commit Message

Thomas Weber June 2, 2010, 2:44 p.m. UTC
None

Patch
diff mbox

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index c4dec80..4741fea 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -505,7 +505,10 @@  int conf_write(const char *name)
 				while (1) {
 					l = strcspn(str, "\"\\");
 					if (l) {
-						fwrite(str, l, 1, out);
+						if (fwrite(str, l, 1, out) != 1) {
+							fprintf(stderr, "write str failed\n");
+							return 1;
+						}
 						str += l;
 					}
 					if (!*str)
@@ -756,8 +759,14 @@  int conf_write_autoconf(void)
 			while (1) {
 				l = strcspn(str, "\"\\");
 				if (l) {
-					fwrite(str, l, 1, out);
-					fwrite(str, l, 1, out_h);
+					if (fwrite(str, l, 1, out) != 1) {
+						fprintf(stderr, "write str failed\n");
+						return 1;
+					}
+					if (fwrite(str, l, 1, out_h) != 1) {
+						fprintf(stderr, "write str failed\n");
+						return 1;
+					}
 					str += l;
 				}
 				if (!*str)