Another fix bufer overflow in wide screen: status line don't cuting but shorten
This commit is contained in:
@@ -13,8 +13,22 @@ _____________________________________________________________________________
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD>: "-" - <20><><EFBFBD>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>, "+" - <20><><EFBFBD><EFBFBD><EFBFBD>, "!" - <20><><EFBFBD><EFBFBD><EFBFBD>⢥<EFBFBD><E2A2A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
_____________________________________________________________________________
|
||||
|
||||
+ <20><><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD> ⥪<>⮢ <EFBFBD><EFBFBD>⮯<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨ <20><><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>
|
||||
䠩<EFBFBD><EFBFBD> sources.h <20> golded.spec.
|
||||
- <20><><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>訡<EFBFBD><EFBFBD> ࠡ<EFBFBD><EFBFBD><EFBFBD> <20> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ਢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <20> 64-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᡮઠ<E1A1AE> GCC <20><><EFBFBD>ᨩ 4.*. <20><><EFBFBD>ᨡ<EFBFBD> <20><>⮭<EFBFBD> <20><>૮<EFBFBD><E0ABAE>
|
||||
2:5059/37 <20><> <20><><EFBFBD>९<EFBFBD><E0A5AF><EFBFBD><EFBFBD>.
|
||||
|
||||
+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Gentoo ebuild, ᯠᨡ<E1AFA0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2:5025/121@fidonet.
|
||||
|
||||
+ <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <20> <20><>ப<EFBFBD> <20><><EFBFBD><EFBFBD>᪠ make <20><><EFBFBD><EFBFBD><EFBFBD> 㪠<>뢠<EFBFBD><EBA2A0> <20><><EFBFBD>쪮 <20><>ࠬ<EFBFBD><E0A0AC>
|
||||
<20>⮡<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ਠ<EFBFBD><E0A8A0> ᡮન.
|
||||
|
||||
! <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2:5025/121@fidonet <20>뤥<EFBFBD><EBA4A5><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>, <20><>易<EFBFBD><EFA7A0><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD><E2A5AA>
|
||||
ncurses <20> <20>⤥<EFBFBD><E2A4A5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD> Goldnode <20> RDDT <20><><EFBFBD><EFBFBD><EFBFBD> <20><>
|
||||
<20><><EFBFBD>᮫<EFBFBD> <>ᮯ<EFBFBD><E1AEAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>.
|
||||
|
||||
+ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>室<EFBFBD><E5AEA4><EFBFBD> ⥪<>⮢ <20><>⮬<EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD>᪨ <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD><EFBFBD> <20>
|
||||
䠩<><E4A0A9> sources.h <20> golded.spec. <20><><EFBFBD><EFBFBD> <20><> sources.h <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
||||
<20><>ନ<E0ACA8><E0AEA2><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20><><EFBFBD>ᨨ <20><><EFBFBD> ᭠<><E1ADA0><EFBFBD>⮢ Golded+.
|
||||
|
||||
! <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Golded+ <20>뢮<EFBFBD><EBA2AE><EFBFBD> <20>訡<EFBFBD><E8A8A1> <20>⥭<EFBFBD><E2A5AD> <20><><EFBFBD>䨣<EFBFBD> <20> stderr <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> stdout. <20>⮡<EFBFBD>
|
||||
<20><>ᬮ<EFBFBD><E1ACAE><EFBFBD><EFBFBD><EFBFBD> ⮫쪮 <20>訡<EFBFBD><E8A8A1>, <20><><EFBFBD>짮<EFBFBD><ECA7AE>⥫<EFBFBD> <>ᮯ<EFBFBD><E1AEAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD>
|
||||
|
@@ -13,8 +13,21 @@ ______________________________________________________________________
|
||||
Legend: "-" - bugfix, "+" - new feature, "!" - important modification.
|
||||
______________________________________________________________________
|
||||
|
||||
- Many mistakes of work in the memory, leading to emergency end of
|
||||
Golded+ in x64 GCC 4.x builds are corrected. Thank Anton Gorlov
|
||||
2:5059/37 for debugging and reporting about bugs.
|
||||
|
||||
+ Gentoo ebuild is added. Thank for Semen Panevin, 2:5025/121@fidonet.
|
||||
|
||||
+ You may run make with several parameters to specify variant of build.
|
||||
|
||||
! Semen Panevin, 2:5025/121@fidonet has extracted all code related
|
||||
with library ncurses in separate library. Now messages of Goldnode
|
||||
and RDDT are visible on the console of unix-like OS.
|
||||
|
||||
+ Date of last change of sources automatically remains in a files
|
||||
srcdate.h and golded.spec.
|
||||
srcdate.h and golded.spec. Date from srcdate.h uses for forming
|
||||
version string for Golded+ snapshot.
|
||||
|
||||
! Now Golded+ outputs errors of reading of a config in stderr instead
|
||||
stdout. To look only errors, the user unix-like OS can use a
|
||||
|
@@ -41,8 +41,9 @@ void update_statuslines() {
|
||||
char buf[200]; /* FIXME: it is need to use dinamic arrays in this fuction to prevent buffer overflow or screen garbage */
|
||||
char * const buf_end = buf+199;
|
||||
static char old_status_line[200] = "";
|
||||
char * const old_status_line_end = old_status_line_end+199;
|
||||
char * const old_status_line_end = old_status_line+199;
|
||||
static int called = NO;
|
||||
const int WIDE= sizeof(buf)>MAXCOL? MAXCOL : sizeof(buf)-1;
|
||||
|
||||
HandleGEvent(EVTT_REMOVEVOCBUF);
|
||||
|
||||
@@ -81,13 +82,13 @@ void update_statuslines() {
|
||||
|
||||
int help_len = strlen(help);
|
||||
int clk_len = strlen(clkinfo);
|
||||
int len = MAXCOL-help_len-clk_len-2;
|
||||
int len = WIDE-help_len-clk_len-2;
|
||||
snprintf(buf,sizeof(buf), "%c%s%-*.*s%s ", goldmark, help, len, len, information, clkinfo);
|
||||
|
||||
char *begin = buf;
|
||||
char *obegin = old_status_line;
|
||||
char *end = (sizeof(buf) > MAXCOL) ? buf + MAXCOL: buf_end;
|
||||
char *oend = (sizeof(old_status_line) > MAXCOL) ? old_status_line + MAXCOL: old_status_line_end;
|
||||
char *end = buf + WIDE;
|
||||
char *oend = old_status_line + WIDE;
|
||||
while((*begin != NUL) and (*begin == *obegin) and (begin<buf_end) and (obegin<old_status_line_end)) {
|
||||
++begin;
|
||||
++obegin;
|
||||
@@ -115,8 +116,8 @@ void update_statuslines() {
|
||||
wwprintstr(W_STAT, 0,begin-buf, C_STATW, begin);
|
||||
if(*help and ((begin - buf) < (help_len-1)) and ((end - buf) > (help_len-1)))
|
||||
wwprintc(W_STAT, 0,help_len-1, C_STATW, sep);
|
||||
if(((begin - buf) < (MAXCOL-clk_len)) and ((end - buf) > (MAXCOL-clk_len)))
|
||||
wwprintc(W_STAT, 0,MAXCOL-clk_len, C_STATW, sep);
|
||||
if(((begin - buf) < (WIDE-clk_len)) and ((end - buf) > (WIDE-clk_len)))
|
||||
wwprintc(W_STAT, 0,WIDE-clk_len, C_STATW, sep);
|
||||
vposset(row, col);
|
||||
#ifdef GOLD_MOUSE
|
||||
if(gmou.Row() == MAXROW-1)
|
||||
|
Reference in New Issue
Block a user