diff options
author | Eric Wong <normalperson@yhbt.net> | 2007-02-19 07:58:03 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2007-02-19 07:58:03 +0000 |
commit | 772dc6bc66e401bb6e1c27b120d6bdcee70aa193 (patch) | |
tree | b552bf550c60b1f38da9f647f2b34c0edd70145f /src/myfprintf.c | |
parent | 93726921273e4d8ae6f38e0f441e013d6fa7890d (diff) | |
download | mpd-772dc6bc66e401bb6e1c27b120d6bdcee70aa193.tar.gz mpd-772dc6bc66e401bb6e1c27b120d6bdcee70aa193.tar.xz mpd-772dc6bc66e401bb6e1c27b120d6bdcee70aa193.zip |
inputStream_http: cleanup GET request code (finishHTTPInit)
Avoid unnecessary memset to zero, snprintf always puts a
trailing '\0'. We also have no need to subtract one from the
buffer we're snprintf-ing it to.
We also check the return value of snprintf to ensure it's not
too long. I have a feeling we might as well avoid snprintf
altogether so we don't have to worry about buffer sizing/stack
overflow and just do a bunch of write(2)s, letting Nagle sort it
out...
Also, centralize some of the exit error handling in with
goto. This makes the code a bit more consistent and
maintainable as well as reducing code and binary size.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5395 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/myfprintf.c')
0 files changed, 0 insertions, 0 deletions