From 25ed963d021c3db1d8a07c0a548b595047bdeb96 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Wed, 9 May 2018 21:54:22 +0100 Subject: rev: move a global variable to local scope Mark also file names read-only. Signed-off-by: Sami Kerola --- text-utils/rev.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'text-utils/rev.c') 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; -- cgit v1.2.3-55-g7522