[PATCH] scriptreplay: fscanf portability fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a fix to an issue with llvm clang which I reported
earlier.

http://www.spinics.net/lists/util-linux-ng/msg04331.html

When compiling with clang fscanf format string %[\n] will not
work. For now using %c in format string seems to be best option.

p.s. The llvm people are informed about the issue.
http://llvm.org/bugs/show_bug.cgi?id=10443

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 term-utils/scriptreplay.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/term-utils/scriptreplay.c b/term-utils/scriptreplay.c
index 96993d5..7f1b497 100644
--- a/term-utils/scriptreplay.c
+++ b/term-utils/scriptreplay.c
@@ -203,7 +203,7 @@ main(int argc, char *argv[])
 		size_t blk;
 		char nl;
 
-		if ((fscanf(tfile, "%lf %zd%[\n]\n", &delay, &blk, &nl) != 3) ||
+		if ((fscanf(tfile, "%lf %zd%c\n", &delay, &blk, &nl) != 3) ||
 							(nl != '\n')) {
 			if (feof(tfile))
 				break;
-- 
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux