aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ape_tag.h
diff options
context:
space:
mode:
authorGravatar Rogério Brito <rbrito@ime.usp.br>2011-03-08 15:04:35 -0300
committerGravatar Rogério Brito <rbrito@ime.usp.br>2011-03-08 17:35:58 -0300
commitf82b55da8dc8389e3e4e0021804231541aa5d71b (patch)
tree0f143a0db484a0b2b4b1b34f09649a4907e4d2a1 /src/ape_tag.h
parent891b53ce003db7be264bba8b6cd3d547c050099f (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 'src/ape_tag.h')
0 files changed, 0 insertions, 0 deletions