summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)