summaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/ubiformat.c.patch
blob: 7539d76e381a5213b299f643b5643d49f44030f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- a/ubi-utils/ubiformat.c	2012-05-03 01:14:39.000000000 +0200
+++ b/ubi-utils/ubiformat.c	2012-05-03 01:00:57.000000000 +0200
@@ -246,7 +246,11 @@
 
 	while (1) {
 		normsg_cont("continue? (yes/no)  ");
-		if (scanf("%3s", buf) == EOF) {
+
+		fflush(stderr);
+		fflush(stdout);
+
+		if (fgets(buf,4,stdin) == NULL) {
 			sys_errmsg("scanf returned unexpected EOF, assume \"yes\"");
 			return 1;
 		}
@@ -259,10 +263,13 @@
 
 static int answer_is_yes(void)
 {
+	fflush(stderr);
+	fflush(stdout);
+
 	char buf[4];
 
 	while (1) {
-		if (scanf("%3s", buf) == EOF) {
+		if (fgets(buf,4,stdin) == NULL) {
 			sys_errmsg("scanf returned unexpected EOF, assume \"no\"");
 			return 0;
 		}
OpenPOWER on IntegriCloud