summaryrefslogtreecommitdiff
path: root/libvxi11client
diff options
context:
space:
mode:
Diffstat (limited to 'libvxi11client')
-rw-r--r--libvxi11client/libvxi11client.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c
index 219a17f..7b23c43 100644
--- a/libvxi11client/libvxi11client.c
+++ b/libvxi11client/libvxi11client.c
@@ -153,7 +153,8 @@ int vxi11_open(VXI11Context* context, char* address, char* device) {
/**
* read the status byte of the connected server
- * returns -1
+ * returns the status byte or'ed with 0x100 on success
+ * so that you can tell a zero status byte from an error
*/
int vxi11_readstatusbyte(VXI11Context* context, bool waitforlock) {
@@ -234,6 +235,7 @@ int vxi11_read(VXI11Context* context, char* buffer, unsigned int bufferlen, bool
/**
* call docmd with the specified command
+ * datainlen will be calculated with strlen if less than 0
*/
int vxi11_docmd(VXI11Context* context, char* datain, int datainlen, char* dataout, int outbufferlen, int* dataoutlen,
@@ -247,8 +249,8 @@ int vxi11_docmd(VXI11Context* context, char* datain, int datainlen, char* dataou
if (datain == NULL)
datainlen = 0;
- else if (datainlen == -1)
- datainlen = strlen(datain);
+ else if (datainlen < 0)
+ datainlen = strlen(datain) + 1;
params.data_in.data_in_len = datainlen;
params.data_in.data_in_val = datain;