Clean up whitespaces

This commit is contained in:
Martin Lund 2023-09-16 12:27:34 +02:00
parent 07864a0e78
commit cf6e8b963b

View file

@ -4,7 +4,7 @@
* https://en.wikipedia.org/wiki/YMODEM * https://en.wikipedia.org/wiki/YMODEM
* *
* SPDX-License-Identifier: GPL-2.0-or-later OR MIT-0 * SPDX-License-Identifier: GPL-2.0-or-later OR MIT-0
* *
*/ */
#include <stdio.h> #include <stdio.h>
@ -59,7 +59,7 @@ static int xmodem(int sio, const void *data, size_t len, int seq)
const uint8_t *buf = data; const uint8_t *buf = data;
char resp = 0; char resp = 0;
int rc, crc; int rc, crc;
/* Drain pending characters from serial line. Insist on the /* Drain pending characters from serial line. Insist on the
* last drained character being 'C'. * last drained character being 'C'.
*/ */
@ -112,7 +112,7 @@ static int xmodem(int sio, const void *data, size_t len, int seq)
from += rc; from += rc;
sz -= rc; sz -= rc;
} }
/* 'lrzsz' does not ACK ymodem's fin packet */ /* 'lrzsz' does not ACK ymodem's fin packet */
if (seq == 0 && packet.data[0] == 0) resp = ACK; if (seq == 0 && packet.data[0] == 0) resp = ACK;
@ -130,7 +130,7 @@ static int xmodem(int sio, const void *data, size_t len, int seq)
} }
break; break;
} }
/* Update "progress bar" */ /* Update "progress bar" */
switch (resp) { switch (resp) {
case NAK: status = 'N'; break; case NAK: status = 'N'; break;
@ -178,7 +178,7 @@ int xymodem_send(int sio, const char *filename, char mode)
int rc, fd; int rc, fd;
struct stat stat; struct stat stat;
const uint8_t *buf; const uint8_t *buf;
/* Open file, map into memory */ /* Open file, map into memory */
fd = open(filename, O_RDONLY); fd = open(filename, O_RDONLY);
if (fd < 0) { if (fd < 0) {
@ -214,7 +214,7 @@ int xymodem_send(int sio, const char *filename, char mode)
} }
} }
key_hit = 0xff; key_hit = 0xff;
/* Flush serial and release resources */ /* Flush serial and release resources */
tcflush(sio, TCIOFLUSH); tcflush(sio, TCIOFLUSH);
munmap((void *)buf, len); munmap((void *)buf, len);