From 637a3c33da362a45a06a8b8091cea2a2211a1c82 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 21 Oct 2016 15:38:20 +0200 Subject: use the approach used by the msys2 porter --- camlibs/sonydscf1/command.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/camlibs/sonydscf1/command.c b/camlibs/sonydscf1/command.c index b70b9ca0d..162cb8c7a 100644 --- a/camlibs/sonydscf1/command.c +++ b/camlibs/sonydscf1/command.c @@ -139,12 +139,14 @@ char F1newstatus(GPPort *port, int verbose, char *return_buf) unsigned char buf[34]; char status_buf[1000]=""; char tmp_buf[150]=""; + int i; + buf[0] = 0x03; buf[1] = 0x02; sendcommand(port,buf, 2); - recvdata(port, buf, 33); + i = recvdata(port, buf, 33); #ifdef DEBUG - fprintf(stderr,"Status: %02x%02x:%02x\n", buf[0], buf[1], buf[2]); + fprintf(stderr,"Status: %02x%02x:%02x(len = %d)\n", buf[0], buf[1], buf[2], i); #endif if((buf[0] != 0x03) || (buf[1] != 0x02) ||(buf[2] != 0)){ Abort(port); @@ -191,15 +193,15 @@ char F1newstatus(GPPort *port, int verbose, char *return_buf) int F1status(GPPort *port) { - unsigned char buf[34]; + int i; buf[0] = 0x03; buf[1] = 0x02; sendcommand(port,buf, 2); - recvdata(port, buf, 33); + i = recvdata(port, buf, 33); #ifdef DEBUG - fprintf(stderr,"Status: %02x%02x:%02x\n", buf[0], buf[1], buf[2]); + fprintf(stderr,"Status: %02x%02x:%02x(len = %d)\n", buf[0], buf[1], buf[2], i); #endif if((buf[0] != 0x03) || (buf[1] != 0x02) ||(buf[2] != 0)){ Abort(port); @@ -267,15 +269,16 @@ int F1fopen(GPPort *port, char *name) int F1fclose(GPPort*port) { unsigned char buf[4]; + int i; buf[0] = 0x02; buf[1] = 0x0B; buf[2] = 0x00; buf[3] = 0x00; sendcommand(port,buf, 4); - recvdata(port, buf, 3); + i = recvdata(port, buf, 3); #ifdef DEBUG - fprintf(stderr,"Fclose: %02x%02x:%02x\n", buf[0], buf[1], buf[2]); + fprintf(stderr,"Fclose: %02x%02x:%02x(len = %d)\n", buf[0], buf[1], buf[2], i); #endif if((buf[0] != 0x02) || (buf[1] != 0x0B) || (buf[2] != 0x00)){ fprintf(stderr,"F1fclose fail\n"); -- cgit v1.2.1