mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-03-14 14:58:06 +08:00
Ignore the return code of snprintf(); it is useless.
This commit is contained in:
@@ -877,6 +877,8 @@ int post_common_handler(worker_st * ws, unsigned http_ver)
|
|||||||
ws->config->banner);
|
ws->config->banner);
|
||||||
if (size <= 0)
|
if (size <= 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
/* snprintf() returns not a very useful value, so we need to recalculate */
|
||||||
|
size = strlen(msg);
|
||||||
} else {
|
} else {
|
||||||
msg[0] = 0;
|
msg[0] = 0;
|
||||||
size = 0;
|
size = 0;
|
||||||
@@ -964,8 +966,11 @@ int parse_reply(worker_st * ws, char *body, unsigned body_length,
|
|||||||
field_size = xml_field_size;
|
field_size = xml_field_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
temp1_len = snprintf(temp1, sizeof(temp1), "<%s>", field);
|
snprintf(temp1, sizeof(temp1), "<%s>", field);
|
||||||
temp2_len = snprintf(temp2, sizeof(temp2), "</%s>", field);
|
snprintf(temp2, sizeof(temp2), "</%s>", field);
|
||||||
|
|
||||||
|
temp1_len = strlen(temp1);
|
||||||
|
temp2_len = strlen(temp2);
|
||||||
|
|
||||||
/* body should contain <username>test</username><password>test</password> */
|
/* body should contain <username>test</username><password>test</password> */
|
||||||
*value =
|
*value =
|
||||||
@@ -988,7 +993,8 @@ int parse_reply(worker_st * ws, char *body, unsigned body_length,
|
|||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
} else { /* non-xml version */
|
} else { /* non-xml version */
|
||||||
temp1_len = snprintf(temp1, sizeof(temp1), "%s=", field);
|
snprintf(temp1, sizeof(temp1), "%s=", field);
|
||||||
|
temp1_len = strlen(temp1);
|
||||||
|
|
||||||
/* body should be "username=test&password=test" */
|
/* body should be "username=test&password=test" */
|
||||||
*value =
|
*value =
|
||||||
|
|||||||
Reference in New Issue
Block a user