fix null pointer dereferencing introduced in 80e95ac165

This commit is contained in:
Garux 2020-02-07 22:35:58 +03:00
parent 433b9e776b
commit a1fe170f38

View File

@ -291,7 +291,7 @@ void Q_mkdir( const char *path ){
if ( errno == ENOENT ) { if ( errno == ENOENT ) {
p = path_get_last_separator( path ); p = path_get_last_separator( path );
} }
if ( !strEmpty( p ) ) { if ( !strEmptyOrNull( p ) ) {
strcpyQ( parentbuf, path, p - path + 1 ); strcpyQ( parentbuf, path, p - path + 1 );
if ( ( p - path ) < (ptrdiff_t) sizeof( parentbuf ) ) { if ( ( p - path ) < (ptrdiff_t) sizeof( parentbuf ) ) {
Sys_Printf( "mkdir: %s: creating parent %s first\n", path, parentbuf ); Sys_Printf( "mkdir: %s: creating parent %s first\n", path, parentbuf );