From c314cad726a05269c7c7e21200175ee3a79d2ae3 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 29 Jan 2013 01:41:48 +0900 Subject: update some comments --- libvxi11client/libvxi11client.c | 8 +++++--- 1 file 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; -- cgit