Closed offa closed 9 years ago
Thanks!
The tests fail because we actually need more than 5 digits for the number of samples, to run statistical tests:
https://github.com/defuse/passgen/blob/master/tools/statistical_test.rb#L2
I'll fix that up then merge it. Why is %5d
better than %d
, is there some risk to using %d
?
The tests fail because we actually need more than 5 digits for the number of samples, to run statistical tests:
I see. Was realy surprised - my changes aren't that big to fail the tests.
Why is %5d better than %d, is there some risk to using %d?
With %5d
scanf() parses only 5 digits; without you can feed as much digits you can supply. This can cause problems up to a crash.
On 10/20/2014 01:45 PM, offa wrote:
The tests fail because we actually need more than 5 digits for the number of samples, to run statistical tests:
I see. Was realy surprised - my changes aren't that big to fail the tests.
Hehehe. I have strict tests. ;)
Why is %5d better than %d, is there some risk to using %d?
With
%5d
scanf() parses only 5 digits; without you can feed as much digits you can supply. This can cause problems up to a crash.
Makes sense. I'll use %10d since that can represent at least 32-bit numbers.
I've pushed a commit with length set to 10 - let's see, what travis says now.
Ok, better now - but not perfect.
Awesome, thanks very much!
I have fixed three (possible) leaks.