Skip to content

check the length of lists given in options before writing them - #48

Merged
haesbaert merged 3 commits into
mirage:masterfrom
yomimono:empty-options
Mar 29, 2017
Merged

check the length of lists given in options before writing them#48
haesbaert merged 3 commits into
mirage:masterfrom
yomimono:empty-options

Conversation

@yomimono

Copy link
Copy Markdown
Contributor

/cc @haesbaert - I don't think this is too gory, what do you think?

@yomimono

Copy link
Copy Markdown
Contributor Author

I should make this parameter optional since there's only one call where it's anything other than 1, standby for force push...

@haesbaert

haesbaert commented Mar 29, 2017

Copy link
Copy Markdown
Member

Hmm I think that's doable, but we really need to check them all before default to min=1.

Can you split the bugfixes/whitespace fixes into a different commit, that wrong code number is a good find.

If after we check them all, it might be that the option could be something like emptyok=true instead of giving a min_len, I suspect we will only use min_len=0.

Since we are here, we might consider minimum length checks on single options too, like strings

Hah, only now I saw that the inverse is already done in options_of_buf.

@yomimono

yomimono commented Mar 29, 2017 via email

Copy link
Copy Markdown
Contributor Author

@haesbaert

Copy link
Copy Markdown
Member

I think the diff is fine, we're already enforcing min_len for every list option on the other way. So we should enforce when encoding too.

Just split them up and I'll merge :D.

Thanks for this !

@haesbaert

Copy link
Copy Markdown
Member

This actually prompted me to have a look at get_8_list and get_16_list, they don't enforce min_len, I'll write a diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants