aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-11-30 14:48:01 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-11-30 15:06:16 +0000
commit56120ca04bc6c0dc4e942504c7abf018b7ef8428 (patch)
tree57fc71e1cc5d2f5579b823903a88060f22b17479 /lib/transfer.c
parent785d76d681fecffd8941159daeef6fda0877a208 (diff)
transfer: Code style policing
Prefer ! rather than NULL in if statements, added comments and updated function spacing, argument spacing and line spacing to be more readble.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 2cc7f7881..a7ab08ecf 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -910,13 +910,16 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
(data->set.prefer_ascii) ||
#endif
(data->set.crlf))) {
- if(data->state.scratch == NULL) {
- data->state.scratch = malloc(2*BUFSIZE);
- if(data->state.scratch == NULL) {
- failf (data, "Failed to alloc scratch buffer!");
+ /* Do we need to allocate a scratch buffer? */
+ if(!data->state.scratch) {
+ data->state.scratch = malloc(2 * BUFSIZE);
+ if(!data->state.scratch) {
+ failf(data, "Failed to alloc scratch buffer!");
+
return CURLE_OUT_OF_MEMORY;
}
}
+
/*
* ASCII/EBCDIC Note: This is presumably a text (not binary)
* transfer so the data should already be in ASCII.