From 4a2605d85eae9b5fa579a54de5888b95fd86ff03 Mon Sep 17 00:00:00 2001 From: The Dax Date: Mon, 5 Aug 2013 23:46:00 -0400 Subject: [PATCH] Switch to strncat instead of sprintf. --- Core/Dialog/PSPOskDialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/Dialog/PSPOskDialog.cpp b/Core/Dialog/PSPOskDialog.cpp index 5de6ad3495..5b441d456a 100755 --- a/Core/Dialog/PSPOskDialog.cpp +++ b/Core/Dialog/PSPOskDialog.cpp @@ -766,10 +766,10 @@ int PSPOskDialog::NativeKeyboard() memset(defaultText, 0, sizeof(defaultText)); if(initial_text.length() < defaultText_len) - sprintf(defaultText, initial_text.c_str()); + strncat(defaultText, initial_text.c_str(), strlen(initial_text.c_str())); else { ERROR_LOG(HLE, "NativeKeyboard: initial text length is too long"); - sprintf(defaultText, "VALUE"); + strncat(defaultText, "VALUE", strlen("VALUE")); } char windowTitle[defaultText_len]; @@ -779,12 +779,12 @@ int PSPOskDialog::NativeKeyboard() ConvertUCS2ToUTF8(description_text, oskParams->fields[0].desc); if(description_text.length() < defaultText_len) - sprintf(windowTitle, description_text.c_str()); + strncat(windowTitle, description_text.c_str(), strlen(description_text.c_str())); size_t maxInputLength = FieldMaxLength(); if(!InputBox_GetString(0, MainWindow::hwndMain, windowTitle, defaultText, input, maxInputLength)) { - sprintf(input, ""); + strncat(input, "", strlen("")); } #endif // TODO: Insert your platform's native keyboard stuff here...