summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-07 18:08:16 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-07 18:10:05 +0200
commitc16221178ca2266f8130ebe5a7adadc1c928bae0 (patch)
tree00fd03c117e9de24388606faccef33efef07d4e3
parenta295f58338b1e0d5dfb2eed57026cafacf266d7d (diff)
Fix regression in fstree_from_file device node format
The format is documented as "<c|b> major minor" but the parser was accidentally changed to require a colon in between. Fixes: 9864ea5b2045f4bd72633152d71dd1c7f8b0b7f9 Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--lib/fstree/fstree_from_file.c4
-rw-r--r--tests/fstree_from_file.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/fstree/fstree_from_file.c b/lib/fstree/fstree_from_file.c
index 53c2cfb..13328d5 100644
--- a/lib/fstree/fstree_from_file.c
+++ b/lib/fstree/fstree_from_file.c
@@ -29,8 +29,8 @@ static int add_device(fstree_t *fs, const char *filename, size_t line_num,
unsigned int maj, min;
char c;
- if (sscanf(extra, "%c %u:%u", &c, &maj, &min) != 3) {
- fprintf(stderr, "%s: %zu: expected '<c|b> major:minor'\n",
+ if (sscanf(extra, "%c %u %u", &c, &maj, &min) != 3) {
+ fprintf(stderr, "%s: %zu: expected '<c|b> major minor'\n",
filename, line_num);
return -1;
}
diff --git a/tests/fstree_from_file.c b/tests/fstree_from_file.c
index 2728397..c5b9b5b 100644
--- a/tests/fstree_from_file.c
+++ b/tests/fstree_from_file.c
@@ -11,8 +11,8 @@ static const char *testdesc =
"# comment line\n"
"slink /slink 0644 2 3 slinktarget\n"
"dir /dir 0755 4 5\n"
-"nod /chardev 0600 6 7 c 13:37\n"
-"nod /blkdev 0600 8 9 b 42:21\n"
+"nod /chardev 0600 6 7 c 13 37\n"
+"nod /blkdev 0600 8 9 b 42 21\n"
"pipe /pipe 0644 10 11\n"
" sock /sock 0555 12 13 ";