summaryrefslogtreecommitdiffstats
path: root/text-utils/rev.c
diff options
context:
space:
mode:
Diffstat (limited to 'text-utils/rev.c')
-rw-r--r--text-utils/rev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/text-utils/rev.c b/text-utils/rev.c
index 31004a070..76a362030 100644
--- a/text-utils/rev.c
+++ b/text-utils/rev.c
@@ -107,6 +107,8 @@ int main(int argc, char *argv[])
argc -= optind;
argv += optind;
+ buf = xmalloc(bufsiz * sizeof(wchar_t));
+
do {
if (*argv) {
if ((fp = fopen(*argv, "r")) == NULL) {
@@ -118,8 +120,6 @@ int main(int argc, char *argv[])
filename = *argv++;
}
- buf = xmalloc(bufsiz * sizeof(wchar_t));
-
while (fgetws(buf, bufsiz, fp)) {
len = wcslen(buf);