diff options
author | daniel <danieruru@gmail.com> | 2013-01-25 23:13:08 +0900 |
---|---|---|
committer | daniel <danieruru@gmail.com> | 2013-01-25 23:13:08 +0900 |
commit | 67801485ab5a9e4509d2bb2cdd9454ee4ed1ab11 (patch) | |
tree | fb44cf1cc418f6511ad5106ae2fa1db73668f103 /libvxi11client/libvxi11client.c | |
parent | e3d04285a9460a8ab13e9725fc2febf1be63a4d9 (diff) |
fix docmd
Diffstat (limited to 'libvxi11client/libvxi11client.c')
-rw-r--r-- | libvxi11client/libvxi11client.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c index f504def..743168f 100644 --- a/libvxi11client/libvxi11client.c +++ b/libvxi11client/libvxi11client.c @@ -243,6 +243,11 @@ int vxi11_docmd(VXI11Context* context, char* datain, int datainlen, char* dataou .io_timeout = VXI11_DEFAULT_TIMEOUT, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .cmd = cmd, .network_order = 0, .datasize = 0 }; + if (datain == NULL) + datainlen = 0; + else if (datainlen == -1) + datainlen = strlen(datain); + params.data_in.data_in_len = datainlen; params.data_in.data_in_val = datain; |