mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 21:16:13 +01:00
check malloc return value for NULL and update docs
`sfFtpDirectoryResponse_getDirectory` can fail and return NULL becuase 'strdup' returns null on failure but `sfFtpDirectoryResponse_getDirectoryUnicode` didn't and just had UB due not checking return value of malloc. typing NULL in the docs made me age 30 years btw
This commit is contained in:
1 parent
6ce8f95553
commit
66e7af4993
2 files changed
+4
-2
No files matched your search
@@ -225,7 +225,7 @@ CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getMessage(const sfFtpDirec
|
||||
///
|
||||
/// \param ftpDirectoryResponse Ftp directory response
|
||||
///
|
||||
/// \return Directory name
|
||||
/// \return Directory name or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse);
|
||||
@@ -239,7 +239,7 @@ CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getDirectory(const sfFtpDir
|
||||
///
|
||||
/// \param ftpDirectoryResponse Ftp directory response
|
||||
///
|
||||
/// \return Directory name
|
||||
/// \return Directory name or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API const sfChar32* sfFtpDirectoryResponse_getDirectoryUnicode(const sfFtpDirectoryResponse* ftpDirectoryResponse);
|
||||
|
||||
Reference in new issue
Block a user