diff options
author | Rogério Brito <rbrito@ime.usp.br> | 2011-03-08 15:04:35 -0300 |
---|---|---|
committer | Rogério Brito <rbrito@ime.usp.br> | 2011-03-08 17:35:58 -0300 |
commit | f82b55da8dc8389e3e4e0021804231541aa5d71b (patch) | |
tree | 0f143a0db484a0b2b4b1b34f09649a4907e4d2a1 /doc/users_guide_french/images/menu_context1.png | |
parent | 891b53ce003db7be264bba8b6cd3d547c050099f (diff) |
cddb: avoid calling strlen many times in just a few statements.
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.
Diffstat (limited to 'doc/users_guide_french/images/menu_context1.png')
0 files changed, 0 insertions, 0 deletions