mirror of
https://github.com/curl/curl.git
synced 2026-07-25 13:47:23 +03:00
tool_getparam: fix the bsearch call for ip-tos names
Follow-up to 3c20ae08b9
Reported-by: Samuel Chiang
Fixes #13932
Closes #13933
This commit is contained in:
parent
267c3b31e9
commit
410111b515
1 changed files with 6 additions and 3 deletions
|
|
@ -1685,9 +1685,12 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
config->tcp_nodelay = toggle;
|
||||
break;
|
||||
case C_IP_TOS: { /* --ip-tos */
|
||||
const struct TOSEntry *entry = bsearch(
|
||||
&nextarg, tos_entries, sizeof(tos_entries)/sizeof(*tos_entries),
|
||||
sizeof(*tos_entries), find_tos);
|
||||
struct TOSEntry find;
|
||||
const struct TOSEntry *entry;
|
||||
find.name = nextarg;
|
||||
entry = bsearch(&find, tos_entries,
|
||||
sizeof(tos_entries)/sizeof(*tos_entries),
|
||||
sizeof(*tos_entries), find_tos);
|
||||
if(entry)
|
||||
config->ip_tos = entry->value;
|
||||
else /* numeric tos value */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue