From: Patrick Pelletier Date: Mon, 20 Aug 2018 17:10:10 +0000 (-0700) Subject: seek test: remove trailing newline from filename X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0a7702626f20a1a00a233a2ef10b9f58500c8e09;p=cc65 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.) --- 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 {