diff --git a/rosapps/cmd/history.c b/rosapps/cmd/history.c index 2ba94792416..9c22f411151 100644 --- a/rosapps/cmd/history.c +++ b/rosapps/cmd/history.c @@ -159,8 +159,8 @@ VOID add_at_bottom(LPTSTR string) - /*fill bottom with string*/ - Bottom->string=malloc(_tclen(string)); + /*fill bottom with string*/ + Bottom->string=malloc(_tcslen(string)+1); _tcscpy(Bottom->string,string); /*save Bottom value*/ diff --git a/rosapps/cmd/misc.c b/rosapps/cmd/misc.c index ffe3b95b55d..2ec26591494 100644 --- a/rosapps/cmd/misc.c +++ b/rosapps/cmd/misc.c @@ -306,6 +306,9 @@ HWND GetConsoleWindow (VOID) TCHAR temp[256]; HWND h=0; + if(h) + return h; + GetConsoleTitle (original, sizeof(original)); _tcscpy (temp, original);