From 7f3a2a22569eb8e4c9fcc1c7f4e51fe0c6155dae Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 8 Oct 2015 11:24:44 +0200 Subject: join some common strings, -400 bytes function old new delta print_intel_cstates 499 511 +12 file_insert 355 364 +9 dpkg_main 2944 2940 -4 ifenslave_main 645 640 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 21/-9) Total: 12 bytes text data bss dec hex filename 937564 932 17676 956172 e970c busybox_old 937164 932 17676 955772 e957c busybox_unstripped Signed-off-by: Denys Vlasenko --- editors/vi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'editors') diff --git a/editors/vi.c b/editors/vi.c index 3db597ae1..f355712ab 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -2910,10 +2910,10 @@ static int file_insert(const char *fn, char *p, int initial) int fd, size; struct stat statbuf; - if (p < text || p > end) { - status_line_bold("Trying to insert file outside of memory"); - return cnt; - } + if (p < text) + p = text; + if (p > end) + p = end; fd = open(fn, O_RDONLY); if (fd < 0) { -- cgit v1.2.3