From 7a3884340f70c64ff21dece383e57160136e8066 Mon Sep 17 00:00:00 2001 From: Mark Lumsden Date: Wed, 30 Dec 2015 20:51:52 +0000 Subject: Small tidy of recently committed transpose-words: unused value assignment and I missed an ABORT case. --- usr.bin/mg/word.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr.bin/mg/word.c') diff --git a/usr.bin/mg/word.c b/usr.bin/mg/word.c index dd1bf349076..4a4d898cebb 100644 --- a/usr.bin/mg/word.c +++ b/usr.bin/mg/word.c @@ -1,4 +1,4 @@ -/* $OpenBSD: word.c,v 1.18 2015/12/29 19:44:32 lum Exp $ */ +/* $OpenBSD: word.c,v 1.19 2015/12/30 20:51:51 lum Exp $ */ /* This file is in the public domain. */ @@ -119,7 +119,6 @@ transposeword(int f, int n) free(word1); return (FALSE); } - tmp_len = strlen(word1); while (n-- > 0) { i = 0; @@ -155,7 +154,7 @@ transposeword(int f, int n) tmp2_w_dotp = curwp->w_dotp; ret = grabword(&word2); - if (ret < 0) { + if (ret < 0 || ret == ABORT) { dobeep(); ewprintf("Error copying word: %s", strerror(ret)); free(word1); -- cgit v1.2.3