openbsd-ports/textproc/xxdiff/patches/patch-src_diffs_cpp

23 lines
764 B
Plaintext

--- src/diffs.cpp.orig Wed Jun 20 14:41:57 2001
+++ src/diffs.cpp Wed Jun 20 14:47:37 2001
@@ -79,16 +79,16 @@ std::string buildTag(
{
char buf[ 1024 ];
char buf2[ 1024 ];
- ::strncpy( buf, tag, sizeof(buf) );
+ ::strlcpy( buf, tag, sizeof(buf) );
// FIXME this could lead to a bug.
if ( useNumber ) {
- ::strncpy( buf2, buf, sizeof(buf2) );
+ ::strlcpy( buf2, buf, sizeof(buf2) );
::snprintf( buf, sizeof(buf), buf2, number );
}
if ( useString ) {
- ::strncpy( buf2, buf, sizeof(buf2) );
+ ::strlcpy( buf2, buf, sizeof(buf2) );
if ( useConditionals ) {
if ( nbFiles == 3 && ( number == 1 || number == 2 ) ) {
::snprintf( buf, sizeof(buf), buf2, conditional2.c_str() );