summaryrefslogtreecommitdiff
path: root/lib/security.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-09-24 00:20:02 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-09-24 00:20:02 +0200
commita10f5b34ff7932060beb4d297be1241b81b64774 (patch)
tree356153cbaffc5ed9aba7effff02ad2e80cc692b8 /lib/security.c
parentb1df37c60ec8f2a0c943b386c103fc4e7d22bd73 (diff)
downloadcurl-a10f5b34ff7932060beb4d297be1241b81b64774.tar.gz
Revert "security.c: buffer_read various fixes."
This reverts commit fbb38de415b7bb7d743e53a7b4b887ffb12b3e5b.
Diffstat (limited to 'lib/security.c')
-rw-r--r--lib/security.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/security.c b/lib/security.c
index cf0a6ff61..693be3f57 100644
--- a/lib/security.c
+++ b/lib/security.c
@@ -223,13 +223,11 @@ static CURLcode read_data(struct connectdata *conn,
}
static size_t
-buffer_read(struct krb4buffer *buf, const char *data, size_t len)
+buffer_read(struct krb4buffer *buf, void *data, size_t len)
{
- size_t buf_capacity = buf->size - buf->index;
- DEBUGASSERT(buf->size > buf->index);
- if(buf_capacity < len)
- len = buf_capacity;
- memcpy(buf, data, len);
+ if(buf->size - buf->index < len)
+ len = buf->size - buf->index;
+ memcpy(data, (char*)buf->data + buf->index, len);
buf->index += len;
return len;
}