2
0

Make source more standard C11 w/POSIX:2008 CLI.

This commit is contained in:
Maarten Billemont
2017-09-25 10:33:31 -04:00
parent 7ece02c73d
commit 3af8aba40c
7 changed files with 26 additions and 28 deletions

View File

@@ -16,7 +16,8 @@
// LICENSE file. Alternatively, see <http://www.gnu.org/licenses/>.
//==============================================================================
#define _WITH_GETLINE
#define _POSIX_C_SOURCE 200809L
#include "mpw-cli-util.h"
#include <unistd.h>
@@ -188,7 +189,7 @@ bool mpw_mkdirs(const char *filePath) {
// The path to mkdir is the filePath without the last path component.
char *pathEnd = strrchr( filePath, '/' );
char *path = pathEnd? strndup( filePath, (size_t)(pathEnd - filePath) ): NULL;
char *path = pathEnd? mpw_strndup( filePath, (size_t)(pathEnd - filePath) ): NULL;
if (!path)
return false;