From: Iain Patterson Date: Tue, 12 Jun 2012 15:18:31 +0000 (+0100) Subject: Fixed buffer length adding a service via the GUI. X-Git-Tag: v2.15~2 X-Git-Url: http://git.iain.cx/?p=nssm.git;a=commitdiff_plain;h=a4ac5c7f008020fff5b667f72a2b9b642d37e5cb Fixed buffer length adding a service via the GUI. The path to the monitored application and the arguments to the application are both allowed to be sufficiently large to fit in the maximum allowable registry value size. The GUI itself, however, was restricting input fields to 256 characters. --- diff --git a/gui.cpp b/gui.cpp index 97c69a8..3d51236 100644 --- a/gui.cpp +++ b/gui.cpp @@ -63,9 +63,9 @@ int install(HWND window) { if (! window) return 1; /* Check parameters in the window */ - char name[STRING_SIZE]; + char name[VALUE_LENGTH]; char exe[EXE_LENGTH]; - char flags[STRING_SIZE]; + char flags[VALUE_LENGTH]; /* Get service name */ if (! GetDlgItemText(window, IDC_NAME, name, sizeof(name))) { @@ -120,7 +120,7 @@ int remove(HWND window) { if (! window) return 1; /* Check parameters in the window */ - char name[STRING_SIZE]; + char name[VALUE_LENGTH]; /* Get service name */ if (! GetDlgItemText(window, IDC_NAME, name, sizeof(name))) { diff --git a/gui.h b/gui.h index 4521c32..805635d 100644 --- a/gui.h +++ b/gui.h @@ -6,8 +6,6 @@ #include #include "resource.h" -#define STRING_SIZE 256 - int nssm_gui(int, char *); void centre_window(HWND); int install(HWND);