summaryrefslogtreecommitdiffstats
path: root/text-utils
diff options
context:
space:
mode:
authorSami Kerola2018-05-09 22:54:22 +0200
committerKarel Zak2018-05-28 13:36:38 +0200
commit25ed963d021c3db1d8a07c0a548b595047bdeb96 (patch)
tree898248d3c2a4471f8f1699017549e693ec65b050 /text-utils
parenttests: move stderr redirection out from test expression (diff)
downloadkernel-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>
Diffstat (limited to 'text-utils')
-rw-r--r--text-utils/rev.c5
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;