sscanf warning


(Mike Kelly) #1

FYI, 1.07.07 has this build warning:

FMODStudio\Source\FMODStudioEditor\Private\FMODStudioEditorModule.cpp(433): warning C4996: ‘sscanf’: This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.


(Geoff Carlton) #2

The use of sscanf is perfect safe, but I’ll ifdef in the sscanf_s version on windows to silence the warning.


(Mike Kelly) #3

I fixed it by changing:

sscanf(TCHAR_TO_UTF8(*StudioVersionString), “Version %x.%x.%x”, &Super, &Major, &Minor);

to:

StudioVersionString.Printf(TEXT(“Version %x.%x.%x”), &Super, &Major, &Minor);


(Geoff Carlton) #4

Well, that would fix the warning, but scanf != printf :slight_smile:


(Geoff Carlton) #5

I’ve removed the sscanf and changed the code to use the unreal string parsing functionality. The warning should be gone in the next patch release.