Fix segfault on wide terminal with long tearline, tagline or origin. Bugreport from 2:5059/37

This commit is contained in:
Stas Degteff 2011-12-01 10:13:51 +00:00
parent f22d4dd7f3
commit 1178743894
3 changed files with 8 additions and 3 deletions

View File

@ -13,6 +13,9 @@ _____________________________________________________________________________
Ž¡®§­ ç¥­¨ï: "-" - ¨á¯à ¢«¥­¨¥, "+" - ­®¢®¥, "!" - áãé¥á⢥­­®¥ ¨§¬¥­¥­¨¥. Ž¡®§­ ç¥­¨ï: "-" - ¨á¯à ¢«¥­¨¥, "+" - ­®¢®¥, "!" - áãé¥á⢥­­®¥ ¨§¬¥­¥­¨¥.
_____________________________________________________________________________ _____________________________________________________________________________
- ˆá¯à ¢«¥­  ®è¨¡ª , ¯à¨¢®¤¨¢è ï ª ¯¥à¥¯®«­¥­¨î ¡ãä¥à  ­  è¨à®ª®¬ â¥à¬¨­ «¥
¯à¨ ¨á¯®«ì§®¢ ­¨¨ ¤«¨­­®£® â £« ©­ , â¨à« ©­  ¨«¨ ®à¨¤¦¨­ .
- “áâà ­ñ­ ª®­ä«¨ªâ á® áâ ­¤ àâ­®© ä㭪樥© pow() ¢ Visual Studio 2010. - “áâà ­ñ­ ª®­ä«¨ªâ á® áâ ­¤ àâ­®© ä㭪樥© pow() ¢ Visual Studio 2010.
+ „«ï ¯à®¢¥àª¨ ®à䮣à ä¨¨ ¬®¦­® ®¤­®¢à¥¬¥­­® ¨á¯®«ì§®¢ âì ­¥áª®«ìª® á«®¢ à¥©. + „«ï ¯à®¢¥àª¨ ®à䮣à ä¨¨ ¬®¦­® ®¤­®¢à¥¬¥­­® ¨á¯®«ì§®¢ âì ­¥áª®«ìª® á«®¢ à¥©.

View File

@ -13,6 +13,8 @@ ______________________________________________________________________
Legend: "-" - bugfix, "+" - new feature, "!" - important modification. Legend: "-" - bugfix, "+" - new feature, "!" - important modification.
______________________________________________________________________ ______________________________________________________________________
- Fix segfault on wide terminal with long tearline, tagline or origin.
- The conflict to standard function pow() in Visual Studio 2010 is - The conflict to standard function pow() in Visual Studio 2010 is
eliminated. eliminated.

View File

@ -1537,7 +1537,7 @@ void ScanKludges(GMsg* msg, int getvalue) {
line->type |= GLINE_TAGL; line->type |= GLINE_TAGL;
line->color = C_READG; line->color = C_READG;
if(AA->Taglinesupport()) if(AA->Taglinesupport())
strbtrim(strcpy(msg->tagline, ptr+3)); strbtrim(strxcpy(msg->tagline, ptr+3, sizeof(msg->tagline)));
} }
} }
@ -1561,7 +1561,7 @@ void ScanKludges(GMsg* msg, int getvalue) {
} }
tearln->type |= GLINE_TEAR; tearln->type |= GLINE_TEAR;
tearln->color = C_READT; tearln->color = C_READT;
strbtrim(strcpy(msg->tearline, ptr+3)); strbtrim(strxcpy(msg->tearline, ptr+3, sizeof(msg->tearline)));
if(getvalue and CFG->gedhandshake) { if(getvalue and CFG->gedhandshake) {
char* tearid[] = { char* tearid[] = {
@ -1606,7 +1606,7 @@ void ScanKludges(GMsg* msg, int getvalue) {
originlineno = lineno; originlineno = lineno;
line->type |= GLINE_ORIG; line->type |= GLINE_ORIG;
line->color = C_READO; line->color = C_READO;
strcpy(msg->origin, line->txt.c_str()+11); strxcpy(msg->origin, line->txt.c_str()+11, sizeof(msg->origin));
if(nextor) { // Get the next line too if(nextor) { // Get the next line too
strcat(msg->origin, line->next->txt.c_str()); strcat(msg->origin, line->next->txt.c_str());
line->next->color = C_READO; line->next->color = C_READO;