From b6af5453bb4dc6966e4540c3c788a3bda37f9dab Mon Sep 17 00:00:00 2001 From: ysf002 Date: Tue, 23 Aug 2022 15:01:34 +0800 Subject: [PATCH] Reading WatchCommand got error WatchCommand is sent as bytes stream, so is read also as bytes steam. So (void* p = &priv->cmd + priv->cmd_bytes_read ) is wrong, it should be char *p = (char*)(&priv->cmd) + priv->cmd_bytes_read. --- daemon/wt-monitor-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/wt-monitor-win32.c b/daemon/wt-monitor-win32.c index 76dd5ac48..796e449ef 100644 --- a/daemon/wt-monitor-win32.c +++ b/daemon/wt-monitor-win32.c @@ -264,7 +264,7 @@ start_watch_cmd_pipe (SeafWTMonitor *monitor, OVERLAPPED *ol_in) HANDLE hPipe = (HANDLE)monitor->cmd_pipe[0]; - void *p = &priv->cmd + priv->cmd_bytes_read; + char *p = (char*)(&priv->cmd) + priv->cmd_bytes_read; int to_read = sizeof(WatchCommand) - priv->cmd_bytes_read; BOOL sts = ReadFile