From 0a7702626f20a1a00a233a2ef10b9f58500c8e09 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Mon, 20 Aug 2018 10:10:10 -0700 Subject: [PATCH] seek test: remove trailing newline from filename Looks like no one ever tried this? fopen was returning EINVAL because fgets was leaving a trailing newline at the end of the filename. (Which is what fgets is documented to do.) --- testcode/lib/seek.c | 1 + 1 file changed, 1 insertion(+) diff --git a/testcode/lib/seek.c b/testcode/lib/seek.c index 0cb1c6ad6..59603a795 100644 --- a/testcode/lib/seek.c +++ b/testcode/lib/seek.c @@ -23,6 +23,7 @@ int main(int argc, char **argv) if (!x) { return(0); } + x[strcspn(x, "\r\n")] = 0; filename = x; } else { -- 2.39.5