More checkpatch.pl happiness
This commit is contained in:
24
confparser.c
24
confparser.c
@@ -214,13 +214,15 @@ static int test_conf_syntax(void)
|
||||
while (fgets(buf, CFGLINESIZE, fp) != NULL) {
|
||||
j++;
|
||||
/* kill comments and ignore BLANK lines */
|
||||
if ((tmp = strstr(buf, "#")))
|
||||
tmp = strstr(buf, "#");
|
||||
if (tmp)
|
||||
*tmp = '\0';
|
||||
if (buf[strspn(buf, " \t\v\r\n")] == '\0')
|
||||
continue;
|
||||
|
||||
/* If we have "=", it's a possible var */
|
||||
if ((tmp = strstr(buf, "=")))
|
||||
tmp = strstr(buf, "=");
|
||||
if (tmp)
|
||||
*tmp = '\0';
|
||||
else {
|
||||
log(ERROR,
|
||||
@@ -258,8 +260,10 @@ static int test_conf_syntax(void)
|
||||
/* Just save it, launch_rmps will check it */
|
||||
strcpy(conf.db.hostname, tmp + 1);
|
||||
else if (!strcmp(buf, "db.port")) {
|
||||
if ((i = strlen(tmp + 1)) < 6) {
|
||||
if ((signed int)strspn(tmp + 1, "1234567890") == i) {
|
||||
i = strlen(tmp + 1);
|
||||
if (i < 6) { /* max 5 digits for network port */
|
||||
if ((signed int)strspn(tmp + 1,
|
||||
"1234567890") == i) {
|
||||
i = atoi(tmp + 1);
|
||||
if (i > 0 && i < 65536) {
|
||||
strcpy(conf.db.port, tmp + 1);
|
||||
@@ -274,8 +278,10 @@ static int test_conf_syntax(void)
|
||||
else if (!strcmp(buf, "rmps.agent_ip")) {
|
||||
/* TODO */
|
||||
} else if (!strcmp(buf, "rmps.agent_port")) {
|
||||
if ((i = strlen(tmp + 1)) < 6) {
|
||||
if ((signed int)strspn(tmp + 1, "1234567890") == i) {
|
||||
i = strlen(tmp + 1);
|
||||
if (i < 6) { /* max 5 digits for network port */
|
||||
if ((signed int)strspn(tmp + 1,
|
||||
"1234567890") == i) {
|
||||
i = atoi(tmp + 1);
|
||||
if (i > 0 && i < 65536) {
|
||||
strcpy(conf.rmps.agent_port,
|
||||
@@ -289,8 +295,10 @@ static int test_conf_syntax(void)
|
||||
} else if (!strcmp(buf, "rmps.client_ip")) {
|
||||
/* TODO */
|
||||
} else if (!strcmp(buf, "rmps.client_port")) {
|
||||
if ((i = strlen(tmp + 1)) < 6) {
|
||||
if ((signed int)strspn(tmp + 1, "1234567890") == i) {
|
||||
i = strlen(tmp + 1);
|
||||
if (i < 6) { /* max 5 digits for network port */
|
||||
if ((signed int)strspn(tmp + 1,
|
||||
"1234567890") == i) {
|
||||
i = atoi(tmp + 1);
|
||||
if (i > 0 && i < 65536) {
|
||||
strcpy(conf.rmps.client_port,
|
||||
|
||||
Reference in New Issue
Block a user