Adjust buffer sizes.
[nssm.git] / registry.cpp
index 0cb552f..158158d 100644 (file)
@@ -17,7 +17,7 @@ int create_messages() {
   }\r
 \r
   /* Get path of this program */\r
-  TCHAR path[MAX_PATH];\r
+  TCHAR path[PATH_LENGTH];\r
   GetModuleFileName(0, path, _countof(path));\r
 \r
   /* Try to register the module but don't worry so much on failure */\r
@@ -609,7 +609,7 @@ int get_parameters(nssm_service_t *service, STARTUPINFO *si) {
   if (get_number(key, NSSM_REG_ROTATE_BYTES_HIGH, &service->rotate_bytes_high, false) != 1) service->rotate_bytes_high = 0;\r
 \r
   /* Change to startup directory in case stdout/stderr are relative paths. */\r
-  TCHAR cwd[MAX_PATH];\r
+  TCHAR cwd[PATH_LENGTH];\r
   GetCurrentDirectory(_countof(cwd), cwd);\r
   SetCurrentDirectory(service->dir);\r
 \r