summaryrefslogtreecommitdiff
path: root/src/stat_cache.c
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2015-02-08 19:10:39 +0000
committerStefan Bühler <stbuehler@web.de>2015-02-08 19:10:39 +0000
commit4365bdbebe4542efc28ce6a79e1341870abc24d3 (patch)
tree589ba9986feae644f090a5c6080f9b39b9eda655 /src/stat_cache.c
parent1be163b44a53eebb0a7b0ed562d12e3f252794e1 (diff)
downloadlighttpd1.4-4365bdbebe4542efc28ce6a79e1341870abc24d3.tar.gz
lighttpd1.4-4365bdbebe4542efc28ce6a79e1341870abc24d3.zip
Remove buffer_prepare_copy() and buffer_prepare_append()
* removed almost all usages of buffer as "memory" (without terminating zero) * refactored cgi variable name encoding From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2977 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/stat_cache.c')
-rw-r--r--src/stat_cache.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/stat_cache.c b/src/stat_cache.c
index b5aa9ce5..b63140e4 100644
--- a/src/stat_cache.c
+++ b/src/stat_cache.c
@@ -219,8 +219,7 @@ static int stat_cache_attr_get(buffer *buf, char *name) {
int attrlen;
int ret;
- attrlen = 1024;
- buffer_prepare_copy(buf, attrlen);
+ buffer_string_prepare_copy(buf, 1023);
attrlen = buf->size - 1;
if(0 == (ret = attr_get(name, "Content-Type", buf->ptr, &attrlen, 0))) {
buf->used = attrlen + 1;
@@ -230,9 +229,9 @@ static int stat_cache_attr_get(buffer *buf, char *name) {
}
#elif defined(HAVE_EXTATTR)
static int stat_cache_attr_get(buffer *buf, char *name) {
- ssize_t attrlen = 1024;
+ ssize_t attrlen;
- buffer_prepare_copy(buf, attrlen);
+ buffer_prepare_copy(buf, 1023);
if (-1 != (attrlen = extattr_get_file(name, EXTATTR_NAMESPACE_USER, "Content-Type", buf->ptr, buf->size - 1))) {
buf->used = attrlen + 1;