openbsd-ports/x11/wxWidgets/patches/patch-src_common_filename_cpp
todd b25888b419 wxWidgets 2.4.2, C++ cross-platform GUI toolkit
www: http://www.wxwidgets.org/

from Andrew Dalgleish   < openbsd at ajd dot net dot au >
many thanks for much persistence!
2004-07-16 21:01:35 +00:00

23 lines
886 B
Plaintext

$OpenBSD: patch-src_common_filename_cpp,v 1.1.1.1 2004/07/16 21:01:35 todd Exp $
--- src/common/filename.cpp.orig 2003-09-20 20:24:24.000000000 +1000
+++ src/common/filename.cpp 2003-10-04 13:24:11.000000000 +1000
@@ -1787,8 +1787,7 @@ public :
}
MacDefaultExtensionRecord( const char * extension , OSType type , OSType creator )
{
- strncpy( m_ext , extension , kMacExtensionMaxLength ) ;
- m_ext[kMacExtensionMaxLength] = 0 ;
+ strlcpy( m_ext , extension , sizeof(m_ext)) ;
m_type = type ;
m_creator = creator ;
}
@@ -1888,7 +1887,7 @@ void wxFileName::MacRegisterDefaultTypeA
MacDefaultExtensionRecord rec ;
rec.m_type = type ;
rec.m_creator = creator ;
- strncpy( rec.m_ext , ext.Lower().c_str() , kMacExtensionMaxLength ) ;
+ strlcpy( rec.m_ext , ext.Lower().c_str() , sizeof(rec.m_ext)) ;
gMacDefaultExtensions.Add( rec ) ;
}
#endif