Fix logging with null varargs.

This commit is contained in:
Ben Vanik 2015-08-29 22:21:58 -07:00
parent 1631e0f234
commit 1d7f345960
2 changed files with 10 additions and 2 deletions

View File

@ -161,8 +161,13 @@ void LogLineFormat(const char level_char, const char* fmt, ...) {
size_t chars_written = vsnprintf(log_format_buffer_.data(), size_t chars_written = vsnprintf(log_format_buffer_.data(),
log_format_buffer_.capacity(), fmt, args); log_format_buffer_.capacity(), fmt, args);
va_end(args); va_end(args);
logger_->AppendLine(xe::threading::current_thread_id(), level_char, if (chars_written != std::string::npos) {
log_format_buffer_.data(), chars_written); logger_->AppendLine(xe::threading::current_thread_id(), level_char,
log_format_buffer_.data(), chars_written);
} else {
logger_->AppendLine(xe::threading::current_thread_id(), level_char, fmt,
std::strlen(fmt));
}
} }
void LogLineVarargs(const char level_char, const char* fmt, va_list args) { void LogLineVarargs(const char level_char, const char* fmt, va_list args) {

View File

@ -45,6 +45,9 @@ SHIM_CALL XamUserGetSigninState_shim(PPCContext* ppc_context,
XELOGD("XamUserGetSigninState(%d)", user_index); XELOGD("XamUserGetSigninState(%d)", user_index);
// Yield, as some games spam this.
xe::threading::MaybeYield();
// Lie and say we are signed in, but local-only. // Lie and say we are signed in, but local-only.
// This should keep games from asking us to sign in and also keep them // This should keep games from asking us to sign in and also keep them
// from initializing the network. // from initializing the network.