diff options
author | daniel <danieruru@gmail.com> | 2013-01-30 13:16:17 +0900 |
---|---|---|
committer | daniel <danieruru@gmail.com> | 2013-01-30 13:16:17 +0900 |
commit | 54394d26b686702091e584d524ad77bfbb469fd4 (patch) | |
tree | 506f3f5bcc06f0c00625802904e2168903cb01fd /libvxi11client/libvxi11client.c | |
parent | af2ad8e37d852f66d499125e75fca92762463678 (diff) |
Data lengths sent to the server shouldn't include the terminator.
Fix up how the handle gets copied out into perl
Diffstat (limited to 'libvxi11client/libvxi11client.c')
-rw-r--r-- | libvxi11client/libvxi11client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c index 601e490..c44f086 100644 --- a/libvxi11client/libvxi11client.c +++ b/libvxi11client/libvxi11client.c @@ -39,7 +39,7 @@ device_intr_srq_1_svc(Device_SrqParms *argp, struct svc_req *rqstp) { #endif if (interruptcallback != NULL ) { - interruptcallback(argp->handle.handle_val); + interruptcallback(g_strndup(argp->handle.handle_val, argp->handle.handle_len)); } static char * result; @@ -196,7 +196,7 @@ int vxi11_write(VXI11Context* context, char* data, int len, bool waitlock, bool Device_WriteParms params = { .lid = context->devicelink, .io_timeout = VXI11_DEFAULT_TIMEOUT, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .flags = vxi11_generateflags(waitlock, end, false) }; - params.data.data_len = len < 0 ? (strlen(data) + 1) : len; + params.data.data_len = len < 0 ? strlen(data) : len; params.data.data_val = data; Device_WriteResp* resp = device_write_1(¶ms, context->clnt); @@ -497,7 +497,7 @@ static gpointer interruptthreadfunc(gpointer data) { return NULL ; } -int vxi11_start_interrupt_server(void (*callback)(char* handle)) { +int vxi11_start_interrupt_server(void (*callback)(gchar* handle)) { interruptcallback = callback; interruptserverstarted = true; g_thread_init(NULL ); @@ -617,7 +617,7 @@ int vxi11_enable_srq(VXI11Context* context, bool enable, char* handle) { if (enable) { if (handle != NULL ) { params.handle.handle_val = handle; - params.handle.handle_len = strlen(handle) + 1; + params.handle.handle_len = strlen(handle); } } else { |