summaryrefslogtreecommitdiff
path: root/vxi11_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'vxi11_server.c')
-rw-r--r--vxi11_server.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/vxi11_server.c b/vxi11_server.c
index 1faa821..741b3fb 100644
--- a/vxi11_server.c
+++ b/vxi11_server.c
@@ -184,10 +184,13 @@ device_read_1_svc(Device_ReadParms *argp, struct svc_req *rqstp) {
}
else {
if (globals.Registers.pending_output_message != NULL) {
- result.data.data_val = globals.Registers.pending_output_message;
- result.data.data_len = strlen(result.data.data_val) + 1;
+ result.data.data_len = strlen(globals.Registers.pending_output_message) + 1;
+ result.data.data_val = calloc(result.data.data_len, 1);
+ strncpy(result.data.data_val, globals.Registers.pending_output_message, result.data.data_len);
+ g_free(globals.Registers.pending_output_message);
+ globals.Registers.pending_output_message = NULL;
#ifdef DEBUG
- printf("sending ---%s---\n", globals.Registers.pending_output_message);
+ printf("sending ---%s---\n", result.data.data_val);
#endif
}
else {