--- src/fl2k_file.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/fl2k_file.c b/src/fl2k_file.c index 1d3697d..a3df0f0 100644 --- a/src/fl2k_file.c +++ b/src/fl2k_file.c @@ -145,11 +145,15 @@ int main(int argc, char **argv) if (dev_index < 0) exit(1);
- file = fopen(filename, "rb"); - if (!file) { - fprintf(stderr, "Failed to open %s\n", filename); - goto out; - } + if (!strcmp(filename, "-")){ + file = stdin; + } else { + file = fopen(filename, "rb"); + if (!file) { + fprintf(stderr, "Failed to open %s\n", filename); + goto out; + } + }
txbuf = malloc(FL2K_BUF_LEN); if (!txbuf) {