summaryrefslogtreecommitdiff
path: root/libvxi11client/libvxi11client.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvxi11client/libvxi11client.c')
-rw-r--r--libvxi11client/libvxi11client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c
index 2c6f3a8..ebd71ee 100644
--- a/libvxi11client/libvxi11client.c
+++ b/libvxi11client/libvxi11client.c
@@ -200,7 +200,7 @@ int vxi11_write(VXI11Context* context, char* data, int len, bool waitlock, bool
*/
int vxi11_read(VXI11Context* context, char* buffer, unsigned int bufferlen, bool waitlock, bool termchrset,
- char termchr) {
+ char termchr, unsigned int* reason) {
if (context->clnt == NULL)
return 0;
@@ -215,6 +215,8 @@ 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");