diff options
-rw-r--r-- | vxi11_server.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/vxi11_server.c b/vxi11_server.c index 43d6ef3..ed529f2 100644 --- a/vxi11_server.c +++ b/vxi11_server.c @@ -189,11 +189,11 @@ device_read_1_svc(Device_ReadParms *argp, struct svc_req *rqstp) { printf("device_read_1_svc()\n"); #endif - if (result.data.data_val != NULL) { + // this free's the data from the last call + if (result.data.data_val != NULL) g_free(result.data.data_val); - result.data.data_val = NULL; - result.data.data_len = 0; - } + + memset(&result, 0, sizeof(result)); if (!isValidLink(argp->lid)) result.error = ERR_INVALIDLINKINDENTIFIER; @@ -211,11 +211,9 @@ device_read_1_svc(Device_ReadParms *argp, struct svc_req *rqstp) { printf("sending ---%s---\n", result.data.data_val); #endif } - else { + else result.data.data_val = NULL; - result.data.data_len = 0; - } - result.error = 0; + result.reason = 0x4; } return &result; |