From dd2bd13cacbe4827f9823f955cb77f8c86a74aea Mon Sep 17 00:00:00 2001 From: victor Date: Fri, 3 Jun 2005 02:19:24 +0000 Subject: Remove rarely used function block_shift_left and block_shift_right, which causes buffer overflow. Fix typo in user.c git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2742 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/edit.c | 58 ++-------------------------------------------------------- mbbsd/user.c | 2 +- 2 files changed, 3 insertions(+), 57 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 584f3abc..7b828631 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1801,54 +1801,6 @@ block_select(void) curr_buf->blockline = curr_buf->currline; } -static void -block_shift_left(void) -{ - textline_t *p, *end; - - setup_block_begin_end(&p, &end); - - while (1) { - if (p->len) { - raw_shift_left(p->data, p->len); - --p->len; - } - if (p == end) - break; - else - p = p->next; - } - if (curr_buf->currpnt > curr_buf->currline->len) - curr_buf->currpnt = curr_buf->currline->len; - curr_buf->redraw_everything = YEA; -} - -/** - * Shift the selected block right. If insert_mode is on, put a ' ' in each - * new place, otherwise, put insert_c instead. - */ -static void -block_shift_right(void) -{ - textline_t *p, *end; - - setup_block_begin_end(&p, &end); - - while (1) { - if (p->len < WRAPMARGIN) { - raw_shift_right(p->data, ++p->len); - p->data[0] = curr_buf->insert_mode ? ' ' : curr_buf->insert_c; - } - if (p == end) - break; - else - p = p->next; - } - if (curr_buf->currpnt > curr_buf->currline->len) - curr_buf->currpnt = curr_buf->currline->len; - curr_buf->redraw_everything = YEA; -} - static inline void display_textline_internal(textline_t *p, int i, int min, int max) { @@ -2706,16 +2658,10 @@ vedit(char *fpath, int saveheader, int *islocal) curr_buf->indent_mode ^= 1; break; case 'j': - if (has_block_selection()) - block_shift_left(); - else - currline_shift_left(); + currline_shift_left(); break; case 'k': - if (has_block_selection()) - block_shift_right(); - else - currline_shift_right(); + currline_shift_right(); break; case 'f': cursor_to_next_word(); diff --git a/mbbsd/user.c b/mbbsd/user.c index 83971b7d..d49a5893 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -1133,7 +1133,7 @@ toregister(char *email, char *genbuf, char *phone, char *career, sethomefile(buf, cuser.userid, "justify"); } snprintf(buf, sizeof(buf), - " " BBSENAME " - [ %s ]", getregcode(genbuf)); + " " BBSNAME " - [ %s ]", getregcode(genbuf)); strlcpy(tmp, cuser.userid, sizeof(tmp)); strlcpy(cuser.userid, str_sysop, sizeof(cuser.userid)); #ifdef HAVEMOBILE -- cgit v1.2.3