diff options
author | Sami Kerola | 2018-05-09 22:54:22 +0200 |
---|---|---|
committer | Karel Zak | 2018-05-28 13:36:38 +0200 |
commit | 25ed963d021c3db1d8a07c0a548b595047bdeb96 (patch) | |
tree | 898248d3c2a4471f8f1699017549e693ec65b050 | |
parent | tests: move stderr redirection out from test expression (diff) | |
download | kernel-qcow2-util-linux-25ed963d021c3db1d8a07c0a548b595047bdeb96.tar.gz kernel-qcow2-util-linux-25ed963d021c3db1d8a07c0a548b595047bdeb96.tar.xz kernel-qcow2-util-linux-25ed963d021c3db1d8a07c0a548b595047bdeb96.zip |
rev: move a global variable to local scope
Mark also file names read-only.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r-- | text-utils/rev.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/text-utils/rev.c b/text-utils/rev.c index 84d116d8c..13a41f633 100644 --- a/text-utils/rev.c +++ b/text-utils/rev.c @@ -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; |