diff options
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r-- | mbbsd/edit.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 0b372209..79ecf7f6 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1,4 +1,4 @@ -/* $Id: edit.c,v 1.4 2002/04/27 15:50:17 in2 Exp $ */ +/* $Id: edit.c,v 1.5 2002/04/28 19:35:29 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -502,7 +502,7 @@ static void read_tmpbuf(int n) { setuserfile(fp_tmpbuf, tmpf); if(n != 0 && n != 5 && more(fp_tmpbuf, NA) != -1) - getdata(b_lines - 1, 0, "�T�wŪ�J��(Y/N)?[Y]", ans, 4, LCECHO); + getdata(b_lines - 1, 0, "�T�wŪ�J��(Y/N)?[Y]", ans, sizeof(ans), LCECHO); if(*ans != 'n' && (fp = fopen(fp_tmpbuf, "r"))) { prevln = currln; prevpnt = currpnt; @@ -523,7 +523,7 @@ static void write_tmpbuf() { if(dashf(fp_tmpbuf)) { more(fp_tmpbuf, NA); getdata(b_lines - 1, 0, "�Ȧs�ɤw����� (A)���[ (W)�мg (Q)�����H[A] ", - ans, 4, LCECHO); + ans, sizeof(ans), LCECHO); if(ans[0] == 'q') return; @@ -544,7 +544,8 @@ static void erase_tmpbuf() { setuserfile(fp_tmpbuf, ask_tmpbuf(3)); if(more(fp_tmpbuf, NA) != -1) - getdata(b_lines - 1, 0, "�T�w�R����(Y/N)?[N]", ans, 4, LCECHO); + getdata(b_lines - 1, 0, "�T�w�R����(Y/N)?[N]", + ans, sizeof(ans), LCECHO); if(*ans == 'y') unlink(fp_tmpbuf); } @@ -706,7 +707,8 @@ static int check_quote() { { char ans[4]; - getdata(12, 12, "(E)�~��s�� (W)�j��g�J�H[E] ", ans, 4, LCECHO); + getdata(12, 12, "(E)�~��s�� (W)�j��g�J�H[E] ", + ans, sizeof(ans), LCECHO); if(ans[0] == 'w') return 0; } @@ -760,10 +762,10 @@ void write_header(FILE *fp) { int defanony = (currbrdattr & BRD_DEFAULTANONYMOUS); if(defanony) getdata(3, 0, "�п�J�A�Q�Ϊ�ID�A�]�i������[Enter]�A" - "�άO��[r]�ίu�W�G", real_name, 12, DOECHO); + "�άO��[r]�ίu�W�G", real_name, sizeof(real_name), DOECHO); else getdata(3, 0, "�п�J�A�Q�Ϊ�ID�A�]�i������[Enter]�ϥέ�ID�G", - real_name, 12, DOECHO); + real_name, sizeof(real_name), DOECHO); if(!real_name[0] && defanony) { strcpy(real_name, "Anonymous"); strcpy(postlog.author, real_name); @@ -893,7 +895,7 @@ write_file(char *fpath, int saveheader, int *islocal) { else msg = "[S]�x�s (L)�����H�� (A)��� (T)����D (E)�~�� " "(R/W/D)Ū�g�R�Ȧs�ɡH"; - getdata(1, 0, msg, ans, 3, LCECHO); + getdata(1, 0, msg, ans, 2, LCECHO); switch(ans[0]) { case 'a': @@ -915,7 +917,7 @@ write_file(char *fpath, int saveheader, int *islocal) { move(3, 0); prints("�¼��D�G%s", save_title); strcpy(ans,save_title); - if(getdata_buf(4, 0, "�s���D�G", ans, TTLEN, DOECHO)) + if(getdata_buf(4, 0, "�s���D�G", ans, sizeof(ans), DOECHO)) strcpy(save_title, ans); return KEEP_EDITING; case 's': @@ -1094,7 +1096,7 @@ static void goto_line(int lino) { char buf[10]; if(lino > 0 || - (getdata(b_lines - 1, 0, "���ܲĴX��:", buf, 10, DOECHO) && + (getdata(b_lines - 1, 0, "���ܲĴX��:", buf, sizeof(buf), DOECHO) && sscanf(buf, "%d", &lino) && lino > 0)) { textline_t* p; @@ -1148,16 +1150,17 @@ char *strcasestr(const char* big, const char* little) { -1: backward */ static void search_str(int mode) { - static char str[80]; + static char str[65]; typedef char* (*FPTR)(); static FPTR fptr; char ans[4] = "n"; if(!mode) { - if(getdata_buf(b_lines - 1, 0,"[�j�M]����r:",str, 65, DOECHO)) + if(getdata_buf(b_lines - 1, 0,"[�j�M]����r:", + str, sizeof(str), DOECHO)) if(*str) { if(getdata(b_lines - 1, 0, "�Ϥ��j�p�g(Y/N/Q)? [N] ", - ans, 4, LCECHO) && *ans == 'y') + ans, sizeof(ans), LCECHO) && *ans == 'y') fptr = strstr; else fptr = strcasestr; @@ -1351,7 +1354,7 @@ static void block_del(int hide) { if(tmpfname[4] != '5' && dashf(fp_tmpbuf)) { more(fp_tmpbuf, NA); getdata(b_lines - 1, 0, "�Ȧs�ɤw����� (A)���[ (W)�мg " - "(Q)�����H[W] ", ans, 4, LCECHO); + "(Q)�����H[W] ", ans, 2, LCECHO); if(*ans == 'q') tmpfname[4] = 'q'; else if(*ans != 'a') @@ -1752,7 +1755,7 @@ int vedit(char *fpath, int saveheader, int *islocal) { "\033[45mP\033[46mC\033[47mW\033[m"); if(getdata(b_lines - 1, 0, "�п�J �G��/�e��/�I��[���`�զr�©�][0wb]�G", - ans, 4, LCECHO)) { + ans, sizeof(ans), LCECHO)) { char t[] = "BRGYLPCW"; char color[15]; char *tmp, *apos = ans; @@ -2112,7 +2115,7 @@ int vedit(char *fpath, int saveheader, int *islocal) { getdata(b_lines - 1, 0, "�϶��L�եk�����J�r��(�w�]���ťզr��)", - ans, 4, LCECHO); + ans, sizeof(ans), LCECHO); insert_c = (*ans) ? *ans : ' '; } insert_character ^= 1; |