X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=nssm.cpp;h=9f3174fb2417857a4dccc78bf1517799fb982699;hb=03f6899464b863fc2dd05e7c8e5047e0c1b9281d;hp=32f1142036aea814d011e269de2f7efd5361a9c6;hpb=6efd80ce312a24f52cd19f6dc8ccc5d4a738aa08;p=nssm.git diff --git a/nssm.cpp b/nssm.cpp index 32f1142..9f3174f 100644 --- a/nssm.cpp +++ b/nssm.cpp @@ -13,16 +13,20 @@ int str_equiv(const TCHAR *a, const TCHAR *b) { } /* Convert a string to a number. */ -int str_number(const TCHAR *string, unsigned long *number) { +int str_number(const TCHAR *string, unsigned long *number, TCHAR **bogus) { if (! string) return 1; - TCHAR *bogus; - *number = _tcstoul(string, &bogus, 0); - if (*bogus) return 2; + *number = _tcstoul(string, bogus, 0); + if (**bogus) return 2; return 0; } +int str_number(const TCHAR *string, unsigned long *number) { + TCHAR *bogus; + return str_number(string, number, &bogus); +} + /* Remove basename of a path. */ void strip_basename(TCHAR *buffer) { size_t len = _tcslen(buffer);