summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-07-17 21:32:32 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-07-17 21:32:32 +0000
commit7b54dc788c1bafcc0452790403758f84f0852854 (patch)
tree5878d487da22ae8118c36937f5be0be95acd7be6 /editors
parent7354244c4aaa22924c3d179eca4af168c27d68f8 (diff)
downloadbusybox-w32-7b54dc788c1bafcc0452790403758f84f0852854.tar.gz
busybox-w32-7b54dc788c1bafcc0452790403758f84f0852854.tar.bz2
busybox-w32-7b54dc788c1bafcc0452790403758f84f0852854.zip
vi: using array data after it fell out of scope is stupid.
Diffstat (limited to '')
-rw-r--r--editors/vi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 1f1d3ca39..27f2a3abd 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2492,6 +2492,14 @@ static int file_write(char *fn, char *first, char *last)
2492static void place_cursor(int row, int col, int optimize) 2492static void place_cursor(int row, int col, int optimize)
2493{ 2493{
2494 char cm1[sizeof(CMrc) + sizeof(int)*3 * 2]; 2494 char cm1[sizeof(CMrc) + sizeof(int)*3 * 2];
2495#if ENABLE_FEATURE_VI_OPTIMIZE_CURSOR
2496 enum {
2497 SZ_UP = sizeof(CMup),
2498 SZ_DN = sizeof(CMdown),
2499 SEQ_SIZE = SZ_UP > SZ_DN ? SZ_UP : SZ_DN,
2500 };
2501 char cm2[SEQ_SIZE * 5 + 32]; // bigger than worst case size
2502#endif
2495 char *cm; 2503 char *cm;
2496 2504
2497 if (row < 0) row = 0; 2505 if (row < 0) row = 0;
@@ -2505,12 +2513,6 @@ static void place_cursor(int row, int col, int optimize)
2505 2513
2506#if ENABLE_FEATURE_VI_OPTIMIZE_CURSOR 2514#if ENABLE_FEATURE_VI_OPTIMIZE_CURSOR
2507 if (optimize && col < 16) { 2515 if (optimize && col < 16) {
2508 enum {
2509 SZ_UP = sizeof(CMup),
2510 SZ_DN = sizeof(CMdown),
2511 SEQ_SIZE = SZ_UP > SZ_DN ? SZ_UP : SZ_DN,
2512 };
2513 char cm2[SEQ_SIZE * 5 + 32]; // bigger than worst case size
2514 char *screenp; 2516 char *screenp;
2515 int Rrow = last_row; 2517 int Rrow = last_row;
2516 int diff = Rrow - row; 2518 int diff = Rrow - row;