Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] scriptreplay: fscanf portability fix
@ 2011-07-22 20:15 Sami Kerola
  2011-07-26  9:58 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Sami Kerola @ 2011-07-22 20:15 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

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@iki.fi>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-26  9:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-22 20:15 [PATCH] scriptreplay: fscanf portability fix Sami Kerola
2011-07-26  9:58 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox