Also remove manual null termination as WelsStrncpy now always takes care of it.
Showing the changes to codec/encoder/core/src/property.cpp (1 of 6 files). Show all
Unified · Split
| @@ -68,8 +68,7 @@ int32_t GetCodeName (str_t* pBuf, int32_t iSize) { · 67 unmodified lines | |||
| 68 | if (iSize <= iLen) | 68 | if (iSize <= iLen) |
| 69 | return 0; | 69 | return 0; |
| 70 | 70 | ||
| 71 | pBuf[iLen] = '\0'; | 71 | WelsStrncpy (pBuf, iSize, WELS_CODE_NAME); // confirmed_safe_unsafe_usage |
| 72 | WelsStrncpy (pBuf, iSize, WELS_CODE_NAME, iLen); // confirmed_safe_unsafe_usage | ||
| 73 | 72 | ||
| 74 | return iLen; | 73 | return iLen; |
| 75 | } | 74 | } |
| @@ -90,8 +89,7 @@ int32_t GetLibName (str_t* pBuf, int32_t iSize) { · 14 unmodified lines | |||
| 90 | if (iSize <= iLen) | 89 | if (iSize <= iLen) |
| 91 | return 0; | 90 | return 0; |
| 92 | 91 | ||
| 93 | pBuf[iLen] = '\0'; | 92 | WelsStrncpy (pBuf, iSize, WELS_LIB_NAME); // confirmed_safe_unsafe_usage |
| 94 | WelsStrncpy (pBuf, iSize, WELS_LIB_NAME, iLen); // confirmed_safe_unsafe_usage | ||
| 95 | 93 | ||
| 96 | return iLen; | 94 | return iLen; |
| 97 | } | 95 | } |
| @@ -112,8 +110,7 @@ int32_t GetVerNum (str_t* pBuf, int32_t iSize) { · 14 unmodified lines | |||
| 112 | if (iSize <= iLen) | 110 | if (iSize <= iLen) |
| 113 | return 0; | 111 | return 0; |
| 114 | 112 | ||
| 115 | pBuf[iLen] = '\0'; | 113 | WelsStrncpy (pBuf, iSize, WELS_VERSION_STR); // confirmed_safe_unsafe_usage |
| 116 | WelsStrncpy (pBuf, iSize, WELS_VERSION_STR, iLen); // confirmed_safe_unsafe_usage | ||
| 117 | 114 | ||
| 118 | return iLen; | 115 | return iLen; |
| 119 | } | 116 | } |
| @@ -134,8 +131,7 @@ int32_t GetIdentInfo (str_t* pBuf, int32_t iSize) { · 14 unmodified lines | |||
| 134 | if (iSize <= iLen) | 131 | if (iSize <= iLen) |
| 135 | return 0; | 132 | return 0; |
| 136 | 133 | ||
| 137 | pBuf[iLen] = '\0'; | 134 | WelsStrncpy (pBuf, iSize, WELS_IDENT); // confirmed_safe_unsafe_usage |
| 138 | WelsStrncpy (pBuf, iSize, WELS_IDENT, iLen); // confirmed_safe_unsafe_usage | ||
| 139 | 135 | ||
| 140 | return iLen; | 136 | return iLen; |
| 141 | } | 137 | } |