From 7495b57bcc156cb4d545af9ca888ad519e7fef70 Mon Sep 17 00:00:00 2001 From: harsh jain Date: Thu, 21 Feb 2019 03:15:56 +0530 Subject: [PATCH] refactor(MenuWorld): code refactor for stddlg Change-Id: Id73404d29ea75f61663e0306eeeb559286d77281 Reviewed-on: https://review.haiku-os.org/c/1072 Reviewed-by: Adrien Destugues --- src/tests/kits/interface/menu/menuworld/stddlg.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/tests/kits/interface/menu/menuworld/stddlg.cpp b/src/tests/kits/interface/menu/menuworld/stddlg.cpp index f1a745f347..f2f121486e 100644 --- a/src/tests/kits/interface/menu/menuworld/stddlg.cpp +++ b/src/tests/kits/interface/menu/menuworld/stddlg.cpp @@ -1,9 +1,9 @@ //-------------------------------------------------------------------- -// +// // stddlg.cpp // // Written by: Owen Smith -// +// //-------------------------------------------------------------------- /* @@ -12,18 +12,17 @@ */ #include -#include +#include #include "constants.h" #include "stddlg.h" + void ierror(const char* msg) { - char* fullMsg = new char[strlen(STR_IERROR) + strlen(msg) + 1]; - strcpy(fullMsg, STR_IERROR); - strcpy(fullMsg, msg); + BString fullMsg(STR_IERROR); + fullMsg << msg; BAlert alert("Internal Error", fullMsg, "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); alert.Go(); - delete [] fullMsg; }