Change overlapping strcpy( x, y )' to SAFEMEMCPY( x, y, strlen( y ) + 1 )'

This commit is contained in:
Hallvard Furuseth 1998-12-27 06:29:45 +00:00
parent d59de0c50f
commit 8d5bcf056d
2 changed files with 2 additions and 2 deletions

View file

@ -569,7 +569,7 @@ time2text( char *ldtimestr, int dateonly )
timestr[ strlen( timestr ) - 1 ] = zone; /* replace trailing newline */
if ( dateonly ) {
strcpy( timestr + 11, timestr + 20 );
SAFEMEMCPY( timestr + 11, timestr + 20, strlen( timestr + 20 ) + 1 );
}
Free ( ldtimestr );

View file

@ -206,7 +206,7 @@ fetch_buffer( char *buffer, int length, FILE *where )
if ( isprint( *p )) {
++p;
} else {
strcpy( p, p + 1 );
SAFEMEMCPY( p, p + 1, strlen( p + 1 ) + 1 );
}
}