Merge pull request #275 from xexyl/1992-gson
This commit is contained in:
1 file changed
+13
-10
+13
-10
@@ -14,16 +14,19 @@
|
|||||||
|
|
||||||
./ag word word2 word3 < /path/to/dictionary
|
./ag word word2 word3 < /path/to/dictionary
|
||||||
|
|
||||||
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this entry to not
|
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) changed the buffer size
|
||||||
use gets(). Previously it had a buffer size of 256 which could easily overflow.
|
in such a way that gets() should be safe (theoretically) as it comes from the
|
||||||
Now in this entry `gets()` is used in a more complicated way (first `m` is set
|
command line. Ideally `fgets()` would be used but this is a more problematic.
|
||||||
to `*++p` in a for loop where `p` is argv and then later `m` is set to point to
|
Previously it had a buffer size of 256 which could easily overflow. Now in this
|
||||||
`h` which is of size 256) and trying to change it to use fgets() proved more a
|
entry `gets()` is used in a more complicated way. First `m` is set to `*++p` in
|
||||||
problem. Since the input must come from the command line Cody changed the buffer
|
a for loop where `p` is argv and then later `m` is set to point to `h` which is
|
||||||
size to `ARG_MAX+1` which should be enough especially since the command expects
|
of size 256. `gets()` is called as `m = gets(m)`) but trying to change it to use
|
||||||
redirecting a dictionary file as part of the command line. This also makes it
|
fgets() proved more a problem. Since the input must come from the command line
|
||||||
possible for longer strings to be read (in case the `gets()` was not used in a
|
Cody changed the buffer size to `ARG_MAX+1` which should be enough (again
|
||||||
loop). Thank you Cody for your assistance!
|
theoretically) especially since the command expects redirecting a dictionary
|
||||||
|
file as part of the command line. This also makes it possible for longer strings
|
||||||
|
to be read (in case the `gets()` was not used in a loop). Thank you Cody for
|
||||||
|
your assistance!
|
||||||
|
|
||||||
|
|
||||||
## Judges' comment:
|
## Judges' comment:
|
||||||
|
|||||||
Reference in new issue
Block a user