]> git.itanic.dy.fi Git - glucose/blobdiff - main.c
Replace strerror() with "%m" at printf
[glucose] / main.c
diff --git a/main.c b/main.c
index a78d6800583425f9709fbf9f5ca25217acea3e76..449fa157873fe3aed9e0856854a5661d650f3db1 100644 (file)
--- a/main.c
+++ b/main.c
@@ -138,7 +138,7 @@ static int dump_entries(struct user_options *opts, int fd, int usage_code)
 int main(int argc, char *argv[])
 {
        struct user_options opts;
-       int fd, usage_code, ret, error;
+       int fd, usage_code, ret;
 
        bzero(&opts, sizeof(opts));
        opts.output_format = CLEAN;
@@ -151,9 +151,8 @@ int main(int argc, char *argv[])
        if (opts.output_path) {
                opts.outf = fopen(opts.output_path, "w");
                if (opts.outf == NULL) {
-                       error = errno;
-                       trace(0, "Failed to open output file %s: %s\n",
-                               opts.output_path, strerror(error));
+                       trace(0, "Failed to open output file \"%s\": %m\n",
+                               opts.output_path);
                        return 1;
                }
        } else {