[Libdivecomputer PATCH] Fix logging of Custom Write

Anton Lundin glance at acc.umu.se
Sun Jan 8 00:18:45 PST 2017


This way we actually trace print the written buffer, even if the caller
doesn't care about how much data he/she actually wrote.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 src/serial_posix.c | 2 +-
 src/serial_win32.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/serial_posix.c b/src/serial_posix.c
index d8f71fa..8d6737b 100644
--- a/src/serial_posix.c
+++ b/src/serial_posix.c
@@ -690,7 +690,7 @@ dc_serial_write (dc_serial_t *device, const void *data, size_t size, size_t *act
 				if (actual)
 					*actual = nbytes;
 			},
-			write, data, size, actual);
+			write, data, size, &nbytes);
 
 	struct timeval tve, tvb;
 	if (device->halfduplex) {
diff --git a/src/serial_win32.c b/src/serial_win32.c
index fea3385..eb5b867 100644
--- a/src/serial_win32.c
+++ b/src/serial_win32.c
@@ -474,7 +474,7 @@ dc_serial_write (dc_serial_t *device, const void *data, size_t size, size_t *act
 				if (actual)
 					*actual = nbytes;
 			},
-			write, data, size, actual);
+			write, data, size, &nbytes);
 
 	LARGE_INTEGER begin, end, freq;
 	if (device->halfduplex) {
-- 
2.9.3



More information about the subsurface mailing list