mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	[misc] fix Clang warnings
This commit is contained in:
		
							parent
							
								
									f1929d7014
								
							
						
					
					
						commit
						8506e47fd3
					
				
					 6 changed files with 16 additions and 13 deletions
				
			
		|  | @ -410,7 +410,7 @@ BOOL ExtractFreeDOS(const char* path) | |||
| 		res_data = (BYTE*)LockResource(res_handle); | ||||
| 		res_size = SizeofResource(NULL, res); | ||||
| 
 | ||||
| 		strcpy(filename, (i<2)?path:locale_path); | ||||
| 		safe_strcpy(filename, sizeof(filename), (i<2)?path:locale_path); | ||||
| 		safe_strcat(filename, sizeof(filename), "\\"); | ||||
| 		safe_strcat(filename, sizeof(filename), res_name[i]); | ||||
| 
 | ||||
|  |  | |||
|  | @ -207,7 +207,7 @@ static | |||
| udf_dirent_t * | ||||
| udf_ff_traverse(udf_dirent_t *p_udf_dirent, char *psz_token) | ||||
| { | ||||
|   while (udf_readdir(p_udf_dirent)) { | ||||
|   while ((p_udf_dirent = udf_readdir(p_udf_dirent))) { | ||||
|     if (strcmp(psz_token, p_udf_dirent->psz_name) == 0) { | ||||
|       char *next_tok = strtok(NULL, udf_PATH_DELIMITERS); | ||||
|        | ||||
|  | @ -226,7 +226,8 @@ udf_ff_traverse(udf_dirent_t *p_udf_dirent, char *psz_token) | |||
|       } | ||||
|     } | ||||
|   } | ||||
|   free(p_udf_dirent->psz_name); | ||||
|   if (p_udf_dirent) | ||||
|     free(p_udf_dirent->psz_name); | ||||
|   return NULL; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -53,7 +53,7 @@ static wchar_t* get_token_data_line(const wchar_t* wtoken, wchar_t* wline) | |||
| 	const wchar_t wspace[] = L" \t";	// The only whitespaces we recognize as such
 | ||||
| 	const wchar_t weol[] = L"\r\n"; | ||||
| 	size_t i, r; | ||||
| 	BOOLEAN quoteth; | ||||
| 	BOOLEAN quoteth = FALSE; | ||||
| 
 | ||||
| 	if ((wtoken == NULL) || (wline == NULL) || (wline[0] == 0)) | ||||
| 		return NULL; | ||||
|  | @ -230,6 +230,7 @@ void parse_update(char* buf, size_t len) | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	for (i=0; i<4; i++) update.version[i] = 0; | ||||
| 	if ((data = get_sanitized_token_data_buffer("version", 1, buf, len)) != NULL) { | ||||
| 		for (i=0; (i<4) && ((token = strtok((i==0)?data:NULL, ".")) != NULL); i++) { | ||||
| 			update.version[i] = (uint8_t)atoi(token); | ||||
|  |  | |||
|  | @ -380,7 +380,6 @@ static BOOL GetDriveInfo(void) | |||
| 	if (!r || size <= 0) { | ||||
| 		uprintf("IOCTL_DISK_GET_DRIVE_LAYOUT_EX failed for drive %c: %s\n", DrivePath[0], WindowsErrorString()); | ||||
| 	} else { | ||||
| 		r = FALSE; | ||||
| 		switch (DriveLayout->PartitionStyle) { | ||||
| 		case PARTITION_STYLE_MBR: | ||||
| 			for (tmp_pos=0, i=0; (i<DriveLayout->PartitionCount)&&(tmp_pos>=0); i++) { | ||||
|  | @ -1098,7 +1097,7 @@ BOOL CALLBACK LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) | |||
| 	HFONT hf; | ||||
| 	long lfHeight; | ||||
| 	DWORD log_size; | ||||
| 	char *log_buffer, *filepath; | ||||
| 	char *log_buffer = NULL, *filepath; | ||||
| 
 | ||||
| 	switch (message) { | ||||
| 	case WM_INITDIALOG: | ||||
|  | @ -1124,7 +1123,8 @@ BOOL CALLBACK LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) | |||
| 			return TRUE; | ||||
| 		case IDC_LOG_SAVE: | ||||
| 			log_size = GetWindowTextLengthU(hLog); | ||||
| 			log_buffer = (char*)malloc(log_size); | ||||
| 			if (log_size > 0) | ||||
| 				log_buffer = (char*)malloc(log_size); | ||||
| 			if (log_buffer != NULL) { | ||||
| 				log_size = GetDlgItemTextU(hDlg, IDC_LOG_EDIT, log_buffer, log_size); | ||||
| 				if (log_size == 0) { | ||||
|  |  | |||
							
								
								
									
										10
									
								
								src/rufus.rc
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								src/rufus.rc
									
										
									
									
									
								
							|  | @ -30,7 +30,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL | |||
| IDD_DIALOG DIALOGEX 12, 12, 206, 316 | ||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||
| EXSTYLE WS_EX_APPWINDOW | ||||
| CAPTION "Rufus v1.2.1.199" | ||||
| CAPTION "Rufus v1.2.1.200" | ||||
| FONT 8, "MS Shell Dlg", 400, 0, 0x1 | ||||
| BEGIN | ||||
|     DEFPUSHBUTTON   "Start",IDC_START,94,278,50,14 | ||||
|  | @ -248,8 +248,8 @@ END | |||
| // | ||||
| 
 | ||||
| VS_VERSION_INFO VERSIONINFO | ||||
|  FILEVERSION 1,2,1,199 | ||||
|  PRODUCTVERSION 1,2,1,199 | ||||
|  FILEVERSION 1,2,1,200 | ||||
|  PRODUCTVERSION 1,2,1,200 | ||||
|  FILEFLAGSMASK 0x3fL | ||||
| #ifdef _DEBUG | ||||
|  FILEFLAGS 0x1L | ||||
|  | @ -266,13 +266,13 @@ BEGIN | |||
|         BEGIN | ||||
|             VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" | ||||
|             VALUE "FileDescription", "Rufus" | ||||
|             VALUE "FileVersion", "1.2.1.199" | ||||
|             VALUE "FileVersion", "1.2.1.200" | ||||
|             VALUE "InternalName", "Rufus" | ||||
|             VALUE "LegalCopyright", "(c) 2011-2012 Pete Batard (GPL v3)" | ||||
|             VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" | ||||
|             VALUE "OriginalFilename", "rufus.exe" | ||||
|             VALUE "ProductName", "Rufus" | ||||
|             VALUE "ProductVersion", "1.2.1.199" | ||||
|             VALUE "ProductVersion", "1.2.1.200" | ||||
|         END | ||||
|     END | ||||
|     BLOCK "VarFileInfo" | ||||
|  |  | |||
|  | @ -141,7 +141,8 @@ void StrArrayClear(StrArray* arr) | |||
| void StrArrayDestroy(StrArray* arr) | ||||
| { | ||||
| 	StrArrayClear(arr); | ||||
| 	safe_free(arr->Table); | ||||
| 	if (arr != NULL) | ||||
| 		safe_free(arr->Table); | ||||
| } | ||||
| 
 | ||||
| /*
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue