increased buffer size to max needed size
authorChristoph von Wittich <christoph_vw@reactos.org>
Sat, 7 Jan 2006 19:54:50 +0000 (19:54 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Sat, 7 Jan 2006 19:54:50 +0000 (19:54 +0000)
replaced _stprintf with _sntprintf

svn path=/trunk/; revision=20667

reactos/subsys/system/servman/query.c

index 2052cbe..24877d7 100644 (file)
@@ -39,7 +39,7 @@ RefreshServiceList(VOID)
     {\r
         HICON hiconItem;     /* icon for list-view items */\r
         HIMAGELIST hSmall;   /* image list for other views */\r
     {\r
         HICON hiconItem;     /* icon for list-view items */\r
         HIMAGELIST hSmall;   /* image list for other views */\r
-        TCHAR buf[256];\r
+        TCHAR buf[300];\r
 \r
         /* Create the icon image lists */\r
         hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON),\r
 \r
         /* Create the icon image lists */\r
         hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON),\r
@@ -53,7 +53,7 @@ RefreshServiceList(VOID)
 \r
         /* set the number of services in the status bar */\r
         LoadString(hInstance, IDS_SERVICES_NUM_SERVICES, szNumServices, 32);\r
 \r
         /* set the number of services in the status bar */\r
         LoadString(hInstance, IDS_SERVICES_NUM_SERVICES, szNumServices, 32);\r
-        _stprintf(buf, szNumServices, NumServices);\r
+        _sntprintf(buf, 300, szNumServices, NumServices);\r
         SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)buf);\r
 \r
 \r
         SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)buf);\r
 \r
 \r
@@ -67,7 +67,7 @@ RefreshServiceList(VOID)
             DWORD dwValueSize;\r
 \r
              /* open the registry key for the service */\r
             DWORD dwValueSize;\r
 \r
              /* open the registry key for the service */\r
-            _stprintf(buf, _T("System\\CurrentControlSet\\Services\\%s"),\r
+            _sntprintf(buf, 300, _T("System\\CurrentControlSet\\Services\\%s"),\r
                       pServiceStatus[Index].lpServiceName);\r
 \r
             if( RegOpenKeyEx(HKEY_LOCAL_MACHINE,\r
                       pServiceStatus[Index].lpServiceName);\r
 \r
             if( RegOpenKeyEx(HKEY_LOCAL_MACHINE,\r