diff options
author | daniel <danieruru@gmail.com> | 2013-01-23 22:25:41 +0900 |
---|---|---|
committer | daniel <danieruru@gmail.com> | 2013-01-23 22:25:41 +0900 |
commit | 609cb1e17a9ab8edf1ccab42574b44bc1439aeb7 (patch) | |
tree | c4c41ab2ad0e922966e0af8d33a90bffd50ab224 /libvxi11client/perlbits/Client.xs | |
parent | 5d66712261026f3f2da0958d98d60fb2142feedd (diff) |
fix the handling of int getting passed back.. returning the address of the int is not what we want.
Diffstat (limited to 'libvxi11client/perlbits/Client.xs')
-rw-r--r-- | libvxi11client/perlbits/Client.xs | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/libvxi11client/perlbits/Client.xs b/libvxi11client/perlbits/Client.xs index b09ee0a..e26190b 100644 --- a/libvxi11client/perlbits/Client.xs +++ b/libvxi11client/perlbits/Client.xs @@ -131,27 +131,25 @@ vxi_read(context, OUTLIST bytesread, OUTLIST buffer, bufferlen, waitlock, termch bool waitlock bool termchrset char termchr - unsigned int* reason + unsigned int reason CODE: - buffer = malloc(bufferlen + 1); - bytesread = vxi11_read(context, buffer, bufferlen, waitlock, termchrset, termchr, reason); + buffer = calloc(bufferlen + 1, 1); + bytesread = vxi11_read(context, buffer, bufferlen, waitlock, termchrset, termchr, &reason); void -vxi_readstatusbyte(context, waitforlock, OUTLIST error, OUTLIST statusbyte) +vxi_readstatusbyte(context, OUTLIST error, OUTLIST statusbyte, waitforlock) VXI11::Client context + int error + int statusbyte bool waitforlock - int* error - int* statusbyte CODE: + error = 0; + statusbyte = 0; int ret = vxi11_readstatusbyte(context, waitforlock); - if(ret > 0){ - *statusbyte = ret & 0xff; - *error = 0; - } - else { - *statusbyte = 0; - *error = ret; - } + if(ret > 0) + statusbyte = ret & 0xff; + else + error = ret; int vxi_remote(context, waitforlock) |