\r
if (! qsc) return 1;\r
\r
- if (is_localsystem(qsc->lpServiceStartName)) return 0;\r
+ if (qsc->lpServiceStartName[0]) {\r
+ if (is_localsystem(qsc->lpServiceStartName)) return 0;\r
\r
- size_t len = _tcslen(qsc->lpServiceStartName);\r
- *username = (TCHAR *) HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(TCHAR));\r
- if (! *username) {\r
- print_message(stderr, NSSM_MESSAGE_OUT_OF_MEMORY, _T("username"), _T("get_service_username()"));\r
- return 2;\r
- }\r
+ size_t len = _tcslen(qsc->lpServiceStartName);\r
+ *username = (TCHAR *) HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(TCHAR));\r
+ if (! *username) {\r
+ print_message(stderr, NSSM_MESSAGE_OUT_OF_MEMORY, _T("username"), _T("get_service_username()"));\r
+ return 2;\r
+ }\r
\r
- memmove(*username, qsc->lpServiceStartName, (len + 1) * sizeof(TCHAR));\r
- *usernamelen = len;\r
+ memmove(*username, qsc->lpServiceStartName, (len + 1) * sizeof(TCHAR));\r
+ *usernamelen = len;\r
+ }\r
\r
return 0;\r
}\r