summaryrefslogtreecommitdiffstats
path: root/term-utils/scriptreplay.c
diff options
context:
space:
mode:
authorSami Kerola2011-07-26 11:49:30 +0200
committerKarel Zak2011-07-26 11:58:38 +0200
commit739de076503015954ab869812e642c774c2b163e (patch)
tree712eec26e4b3ce543e394950868b17c32235236d /term-utils/scriptreplay.c
parentwhereis: update coding style (diff)
downloadkernel-qcow2-util-linux-739de076503015954ab869812e642c774c2b163e.tar.gz
kernel-qcow2-util-linux-739de076503015954ab869812e642c774c2b163e.tar.xz
kernel-qcow2-util-linux-739de076503015954ab869812e642c774c2b163e.zip
scriptreplay: fix buffer overflow
Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/scriptreplay.c')
-rw-r--r--term-utils/scriptreplay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/term-utils/scriptreplay.c b/term-utils/scriptreplay.c
index 96993d5b8..86c82fde7 100644
--- a/term-utils/scriptreplay.c
+++ b/term-utils/scriptreplay.c
@@ -203,8 +203,8 @@ main(int argc, char *argv[])
size_t blk;
char nl;
- if ((fscanf(tfile, "%lf %zd%[\n]\n", &delay, &blk, &nl) != 3) ||
- (nl != '\n')) {
+ if (fscanf(tfile, "%lf %zd%c\n", &delay, &blk, &nl) != 3 ||
+ nl != '\n') {
if (feof(tfile))
break;
if (ferror(tfile))