diff options
author | Cluster <clusterrr@clusterrr.com> | 2015-05-28 09:04:08 +0300 |
---|---|---|
committer | Cluster <clusterrr@clusterrr.com> | 2015-05-28 09:04:08 +0300 |
commit | 5aea2c6200f7f8139de1d6d7f56b7e38606df9db (patch) | |
tree | e6be630b4192c07b4a212758598ebadb3e0a6ad8 | |
parent | ae4ca7b644b002844443d764ac39fe32732787a2 (diff) |
Some fixes
-rw-r--r-- | clujtag.c | 42 | ||||
-rw-r--r-- | clujtag.exe | bin | 93360 -> 93536 bytes |
2 files changed, 22 insertions, 20 deletions
@@ -478,24 +478,7 @@ int main(int argc, char **argv) break; case 'x': case 's': - gotaction = 1; - if (verbose) - fprintf(stderr, "Playing %s file `%s'.\n", opt == 's' ? "SVF" : "XSVF", optarg); - if (!strcmp(optarg, "-")) - f = stdin; - else - f = fopen(optarg, "rb"); - if (f == NULL) { - fprintf(stderr, "Can't open %s file `%s': %s\n", opt == 's' ? "SVF" : "XSVF", optarg, strerror(errno)); - rc = 1; - break; - } - if (libxsvf_play(&h, opt == 's' ? LIBXSVF_MODE_SVF : LIBXSVF_MODE_XSVF) < 0) { - fprintf(stderr, "Error while playing %s file `%s'.\n", opt == 's' ? "SVF" : "XSVF", optarg); - rc = 1; - } - if (strcmp(optarg, "-")) - fclose(f); + gotaction = opt; break; case 'c': gotaction = 1; @@ -514,9 +497,28 @@ int main(int argc, char **argv) break; } } - - if (!gotaction) + + if (gotaction) + { + if (verbose) + fprintf(stderr, "Playing %s file `%s'.\n", opt == 's' ? "SVF" : "XSVF", optarg); + if (!strcmp(optarg, "-")) + f = stdin; + else + f = fopen(optarg, "rb"); + if (f == NULL) { + fprintf(stderr, "Can't open %s file `%s': %s\n", opt == 's' ? "SVF" : "XSVF", optarg, strerror(errno)); + rc = 1; + } + if (libxsvf_play(&h, opt == 's' ? LIBXSVF_MODE_SVF : LIBXSVF_MODE_XSVF) < 0) { + fprintf(stderr, "Error while playing %s file `%s'.\n", opt == 's' ? "SVF" : "XSVF", optarg); + rc = 1; + } + if (strcmp(optarg, "-")) + fclose(f); + } else { help(); + } if (rc == 0) { fprintf(stderr, "Done!\n"); diff --git a/clujtag.exe b/clujtag.exe Binary files differindex 270d223..4f037e3 100644 --- a/clujtag.exe +++ b/clujtag.exe |