File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -409,18 +409,18 @@ char *GetImagePath(void)
409409// Retrieves the path to the temporary directory for the current user.
410410char * GetTempDirectoryPath (void )
411411{
412- char * temp_dir = calloc (1 , MAX_PATH );
412+ char * temp_dir = calloc (MAX_PATH , sizeof ( * temp_dir ) );
413413 if (!temp_dir ) {
414- APP_ERROR ("Failed to memory allocate for get temp directory" );
414+ APP_ERROR ("Memory allocation failed for temp directory" );
415415 return NULL ;
416416 }
417417
418418 if (!GetTempPath (MAX_PATH , temp_dir )) {
419- APP_ERROR ("Failed to get temp path (%lu)" , GetLastError ());
419+ DWORD err = GetLastError ();
420+ APP_ERROR ("Failed to get temp path, Error=%lu" , err );
420421 free (temp_dir );
421422 return NULL ;
422423 }
423-
424424 return temp_dir ;
425425}
426426
You can’t perform that action at this time.
0 commit comments