diff options
Diffstat (limited to 'libvxi11client/libvxi11client.c')
-rw-r--r-- | libvxi11client/libvxi11client.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c index 4697775..c58ad3a 100644 --- a/libvxi11client/libvxi11client.c +++ b/libvxi11client/libvxi11client.c @@ -215,6 +215,8 @@ int vxi11_read(char* buffer, unsigned int bufferlen, bool waitlock, bool termchr #ifdef DEBUG printf("Got \"%s\" from server\n", resp->data.data_val); #endif + if (buffer != NULL) + strncpy(buffer, resp->data.data_val, (bufferlen < resp->data.data_len ? bufferlen : resp->data.data_len)); return resp->data.data_len; } else if (resp == NULL) |