added FIELD.N to 'read' command for retrieving N'th FIELD, fixed getMasterNumber(), check maximum NN in message, use more constants, check all type conversions, added --nodevicecheck to ebusfeed help

This commit is contained in:
john30
2015-02-22 13:57:37 +01:00
parent 564a602eaf
commit d50b3b6cb2
17 changed files with 172 additions and 130 deletions
+3 -3
View File
@@ -40,10 +40,10 @@ using namespace std;
struct options
{
const char* server; //!< ebusd server host (name or ip) [localhost]
int port; //!< ebusd server port [8888]
unsigned int port; //!< ebusd server port [8888]
char* const *args; //!< arguments to pass to ebusd
int argCount; //!< number of arguments to pass to ebusd
unsigned int argCount; //!< number of arguments to pass to ebusd
};
/** the program options. */
@@ -100,7 +100,7 @@ error_t parse_opt(int key, char *arg, struct argp_state *state)
opt->server = arg;
break;
case 'p': // --port=8888
opt->port = strtol(arg, &strEnd, 10);
opt->port = (unsigned int)strtoul(arg, &strEnd, 10);
if (strEnd == NULL || *strEnd != 0 || opt->port < 1 || opt->port > 65535) {
argp_error(state, "invalid port");
return EINVAL;