[NEWINFLIB]

- better fix for non standard use of swprintf, by Thomas Faber

svn path=/trunk/; revision=54795
This commit is contained in:
Jérôme Gardou 2011-12-31 17:29:42 +00:00
parent 50bbe47f26
commit bc18a6c289
2 changed files with 10 additions and 12 deletions

View file

@ -20,10 +20,10 @@ else()
infhostput.c infhostput.c
infhostrtl.c) infhostrtl.c)
add_definitions(-D__NO_CTYPE_INLINES -DINFLIB_HOST) add_definitions(-D__NO_CTYPE_INLINES -DINFLIB_HOST -D_CRT_NON_CONFORMING_SWPRINTFS)
if(NOT MSVC)
add_compile_flags("-Wpointer-arith -Wwrite-strings")
endif()
add_library(inflibhost ${GLOBAL_FILES} ${SOURCE}) add_library(inflibhost ${GLOBAL_FILES} ${SOURCE})
if(NOT MSVC)
add_target_compile_flags(inflibhost "-Wpointer-arith -Wwrite-strings")
endif()
target_link_libraries(inflibhost unicode) target_link_libraries(inflibhost unicode)
endif() endif()

View file

@ -48,10 +48,9 @@ InfpGetSubstitutionString(PINFCACHE Inf,
if (Inf->LanguageId != 0) if (Inf->LanguageId != 0)
{ {
_snwprintf(StringLangId, swprintf(StringLangId,
13, L"Strings.%04hx",
L"Strings.%04hx", Inf->LanguageId);
Inf->LanguageId);
Status = InfpFindFirstLine(Inf, Status = InfpFindFirstLine(Inf,
StringLangId, StringLangId,
@ -59,10 +58,9 @@ InfpGetSubstitutionString(PINFCACHE Inf,
&Context); &Context);
if (Status != INF_STATUS_SUCCESS) if (Status != INF_STATUS_SUCCESS)
{ {
_snwprintf(StringLangId, swprintf(StringLangId,
13, L"Strings.%04hx",
L"Strings.%04hx", MAKELANGID(PRIMARYLANGID(Inf->LanguageId), SUBLANG_NEUTRAL));
MAKELANGID(PRIMARYLANGID(Inf->LanguageId), SUBLANG_NEUTRAL));
Status = InfpFindFirstLine(Inf, Status = InfpFindFirstLine(Inf,
StringLangId, StringLangId,