File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -192,22 +192,28 @@ bool CreateDirectoryUnderInstDir(const char *rel_path)
192192 return false;
193193 }
194194
195- if (rel_path == NULL ) {
195+ if (!rel_path ) {
196+ APP_ERROR ("relative path is NULL" );
196197 return false;
197198 }
198199
199- if (* rel_path == '\0' ) {
200+ /* Treat empty string as a no-op and return success */
201+ if (rel_path [0 ] == '\0' ) {
200202 return true;
201203 }
202204
203205 char * dir = ExpandInstDirPath (rel_path );
204- if (dir == NULL ) {
206+ if (!dir ) {
207+ APP_ERROR ("Failed to build full path" );
205208 return false;
206209 }
207210
208211 bool result = CreateDirectoriesRecursively (dir );
209212 if (!result ) {
210- APP_ERROR ("Failed to create directory under installation directory (InstDir): '%s'" , dir );
213+ APP_ERROR (
214+ "Failed to create directory under installation directory: '%s'" ,
215+ dir
216+ );
211217 }
212218
213219 free (dir );
You can’t perform that action at this time.
0 commit comments