X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=service.cpp;h=ef4ef517f4562491c7b34696ab6aee11401f2b37;hb=7b85809e2f4f36f1cb587e255c72409b06d549a9;hp=ac329bc4506e80fc26fe0098bc5947a79e4c724f;hpb=530bd80072effe809a6d3a2fc5fd847e51342021;p=nssm.git diff --git a/service.cpp b/service.cpp index ac329bc..ef4ef51 100644 --- a/service.cpp +++ b/service.cpp @@ -96,13 +96,12 @@ int install_service(char *name, char *exe, char *flags) { /* Construct command */ char command[CMD_LENGTH]; - size_t runlen = strlen(NSSM_RUN); size_t pathlen = strlen(path); - if (pathlen + runlen + 2 >= VALUE_LENGTH) { + if (pathlen + 1 >= VALUE_LENGTH) { fprintf(stderr, "The full path to " NSSM " is too long!\n"); return 3; } - if (_snprintf(command, sizeof(command), "\"%s\" %s", path, NSSM_RUN) < 0) { + if (_snprintf(command, sizeof(command), "\"%s\"", path) < 0) { fprintf(stderr, "Out of memory for ImagePath!\n"); return 4; }