- Update to r53061
[reactos.git] / base / applications / network / telnet / src / tnmisc.cpp
index 51a2024..0698b19 100644 (file)
@@ -1,8 +1,4 @@
-#include <windows.h>
-#include <stdlib.h>
-#include <memory.h>
-
-#include "tnmisc.h"
+#include "precomp.h"
 
 // from the PVAX (http://www.ccas.ru/~posp/popov/spawn.htm)
 // Create a process with pipes to stdin/out/err
@@ -139,10 +135,9 @@ bool SetIcon(HWND hConsoleWindow, HANDLE hIcon, LPARAM *pOldBIcon, LPARAM *pOldS
 // (Paul Brannan 12/17/98)
 #ifndef __BORLANDC__ // Ioannou Dec. 8, 1998
        if(!hIcon) {
-               char filename[128];                                     // load from telnet.ico
-               strncpy(filename, icondir, sizeof(filename));
-               strncat(filename, "telnet.ico", sizeof(filename));
-               filename[sizeof(filename) - 1] = 0;
+               char filename[MAX_PATH];                                        // load from telnet.ico
+               _snprintf(filename, MAX_PATH - 1, "%s%s", icondir, "telnet.ico");
+               filename[MAX_PATH - 1] = '\0';
 
                // Note: loading the icon from a file doesn't work on NT
                // There is no LoadImage in Borland headers - only LoadIcon
@@ -152,7 +147,7 @@ bool SetIcon(HWND hConsoleWindow, HANDLE hIcon, LPARAM *pOldBIcon, LPARAM *pOldS
 #else
        // load the icon from the resource file -crn@ozemail.com.au 16/12/98
        if(!hIcon) {
-               hIcon = LoadIcon ((HANDLE)GetWindowLong(hConsoleWindow,
+               hIcon = LoadIcon ((HANDLE)GetWindowLongPtr(hConsoleWindow,
                        GWL_HINSTANCE), "TELNETICON");
        }
 #endif