X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=service.cpp;h=62926989e62d6b25ef7fc3c33e2c6c93a1e6f82c;hb=f669237f05d127b88cd66d9dc2a32765ed6b2c23;hp=a400ebde91ea1f453b4aab3ec57b75140f7921d1;hpb=ba3c81e07740130a415c62680bc571b2d8bb5aec;p=nssm.git diff --git a/service.cpp b/service.cpp index a400ebd..6292698 100644 --- a/service.cpp +++ b/service.cpp @@ -101,7 +101,7 @@ int install_service(char *name, char *exe, char *flags) { 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\" %s", path, NSSM_RUN) < 0) { fprintf(stderr, "Out of memory for ImagePath!\n"); return 4; } @@ -235,7 +235,7 @@ int monitor_service() { int ret = start_service(); if (ret) { char code[16]; - snprintf(code, sizeof(code), "%d", ret); + _snprintf(code, sizeof(code), "%d", ret); log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_START_SERVICE_FAILED, exe, service_name, ret, 0); return ret; }