← Commit list

298333051

Glenn L McGrath
Glenn L McGrath
2002-10-06
FAILED Duration: 9s

Subject

Fix segfault when testing if reaidng from stdin "-"

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/tar.c+3 -1
@@ -694,7 +694,9 @@ int tar_main(int argc, char **argv)
}
}
- if (*argv[optind] == '-') {
+ /* Check if we are reading from stdin */
+ if ((argv[optind]) && (*argv[optind] == '-')) {
+ /* Default is to read from stdin, so just skip to next arg */
optind++;
}