| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As strlen is a potentially costly function, it is better if we make a frugal
use of it.
To really make things cleaner here, we should replace all the `\n` or `\r`
with null chars (i.e., `\0`) in just one go. This would reduce the
complexity of the code from something quadratic to something linear in the
length of the string.
While we are at it, `fgets` does not return `EOF` (`fgetc` does, but `fgets`
doesn't) when the end of file is reached and nothing can be read: it returns
`NULL` instead.
|
|
|
|
|
|
|
|
|
|
| |
Some of these functions are way, way too big and should be split. One
obvious low hanging fruit is to use some intelligent goto's to clean up and
avoid a bunch of if's in the code, in the very same fashion that is used in
the code of the kernel.
And, to be honest, using some of the coding style conventions of the kernel
here would not hurt at all.
|
|
|
|
|
| |
Like this one, the code is full of variables that are defined, but not used
and the code can be simplified.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|