]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
rev: move a global variable to local scope
authorSami Kerola <kerolasa@iki.fi>
Wed, 9 May 2018 20:54:22 +0000 (21:54 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 28 May 2018 11:36:38 +0000 (13:36 +0200)
Mark also file names read-only.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/rev.c

index 84d116d8c364166631a8359839edabf47cd0496c..13a41f633e36d74db9dce9d445ae1248548f7bff 100644 (file)
@@ -64,8 +64,6 @@
 #include "c.h"
 #include "closestream.h"
 
-static wchar_t *buf;
-
 static void sig_handler(int signo __attribute__ ((__unused__)))
 {
        _exit(EXIT_SUCCESS);
@@ -100,7 +98,8 @@ static void reverse_str(wchar_t *str, size_t n)
 
 int main(int argc, char *argv[])
 {
-       char *filename = "stdin";
+       char const *filename = "stdin";
+       wchar_t *buf;
        size_t len, bufsiz = BUFSIZ;
        FILE *fp = stdin;
        int ch, rval = EXIT_SUCCESS;