summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-23 21:26:42 +0900
committerdaniel <danieruru@gmail.com>2013-01-23 21:26:42 +0900
commit2e50d8284b0d3e745cb7c24a1a8fa5a60bd1ebcf (patch)
tree0cfee242aef0169a7d97365617947a9f57d40ecd
parent24233b4399b08a164c6ee0464c69d0d6f089bd8e (diff)
Correct buffer null check block
-rw-r--r--libvxi11client/libvxi11client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c
index ebd71ee..5d09786 100644
--- a/libvxi11client/libvxi11client.c
+++ b/libvxi11client/libvxi11client.c
@@ -215,12 +215,12 @@ int vxi11_read(VXI11Context* context, char* buffer, unsigned int bufferlen, bool
#endif
if (buffer != NULL)
strncpy(buffer, resp->data.data_val, (bufferlen < resp->data.data_len ? bufferlen : resp->data.data_len));
- if (reason != NULL)
- *reason = resp->reason;
#ifdef DEBUG
else
printf("Supplied buffer is null!\n");
#endif
+ if (reason != NULL)
+ *reason = resp->reason;
return resp->data.data_len;
}
else if (resp == NULL)