fix warnings from weird code

This commit is contained in:
zeromus 2019-03-17 23:23:48 -04:00
parent aef0374ed8
commit 3dc7e6d70e
1 changed files with 6 additions and 4 deletions

View File

@ -435,8 +435,9 @@ void OpenRWRecentFile(int memwRFileNumber)
do {
fgets(Str_Tmp,1024,WatchFile);
} while (Str_Tmp[0] == '\n');
sscanf(Str_Tmp,"%*05X%*c%08X%*c%c%*c%c%*c%d",&(Temp.Address),&(Temp.Size),&(Temp.Type),&(Temp.WrongEndian));
Temp.WrongEndian = 0;
int wrongEndian;
sscanf(Str_Tmp,"%*05X%*c%08X%*c%c%*c%c%*c%d",&Temp.Address,&Temp.Size,&Temp.Type,&wrongEndian);
Temp.WrongEndian = 0; //why???
char *Comment = strrchr(Str_Tmp,DELIM) + 1;
*strrchr(Comment,'\n') = '\0';
InsertWatch(Temp,Comment);
@ -570,8 +571,9 @@ bool Load_Watches(bool clear, const char* filename)
do {
fgets(Str_Tmp,1024,WatchFile);
} while (Str_Tmp[0] == '\n');
sscanf(Str_Tmp,"%*05X%*c%08X%*c%c%*c%c%*c%d",&(Temp.Address),&(Temp.Size),&(Temp.Type),&(Temp.WrongEndian));
Temp.WrongEndian = 0;
int wrongEndian;
sscanf(Str_Tmp,"%*05X%*c%08X%*c%c%*c%c%*c%d",&Temp.Address,&Temp.Size,&Temp.Type,&wrongEndian);
//Temp.WrongEndian = 0; //WHY?
char *Comment = strrchr(Str_Tmp,DELIM) + 1;
*strrchr(Comment,'\n') = '\0';
InsertWatch(Temp,Comment);