History

Use strlen() instead of WelsStrnlen/STRNLEN for string constants

A string constant is guaranteed to be null terminated, and thus doesn't need to use a version of strlen with a fixed buffer size limit.

Martin Storsjö committed 12 years ago

Commit 082a9861 parent da7d3d94 files · +8 −8Browse files

Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 4 files). Show all

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+1−1
@@ -994,7 +994,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 993 unmodified lines
994994 str_t strFileName[256] = {0};
995995 const int32_t iDataLength = m_iMaxPicWidth * m_iMaxPicHeight;
996996
997− STRNCPY (strFileName, 256, "pic_in_", STRNLEN ("pic_in_", 255)); // confirmed_safe_unsafe_usage
997+ STRNCPY (strFileName, 256, "pic_in_", strlen ("pic_in_")); // confirmed_safe_unsafe_usage
998998
999999 if (m_iMaxPicWidth == 640) {
10001000 STRCAT (strFileName, 256, "360p."); // confirmed_safe_unsafe_usage

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t