aboutsummaryrefslogtreecommitdiff
path: root/src/setopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/setopt.c')
-rw-r--r--src/setopt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/setopt.c b/src/setopt.c
index e000731..a32c8a8 100644
--- a/src/setopt.c
+++ b/src/setopt.c
@@ -351,6 +351,7 @@ static const struct jurl_opt jurl_opts[] = {
// * telnet options
{CURLOPT_TELNETOPTIONS, "telnetoptions", JURL_PARAMTYPE_SLIST},
+ {0, NULL, 0},
};
JANET_CFUN(jurl_setopt) {
@@ -359,7 +360,7 @@ JANET_CFUN(jurl_setopt) {
const struct jurl_opt *opt;
Janet jopt = argv[1];
- for (size_t i = 0; i < sizeof(jurl_opts) / sizeof(struct jurl_opt); i++) {
+ for (size_t i = 0; jurl_opts[i].keyword; i++) {
if (janet_keyeq(jopt, jurl_opts[i].keyword)) {
opt = &jurl_opts[i];
break;
@@ -367,7 +368,7 @@ JANET_CFUN(jurl_setopt) {
}
if (!opt) {
int num = janet_getinteger(argv, 1);
- for (size_t i = 0; i < sizeof(jurl_opts) / sizeof(struct jurl_opt); i++) {
+ for (size_t i = 0; jurl_opts[i].keyword; i++) {
if (num == jurl_opts[i].opt) {
opt = &jurl_opts[i];
break;