diff --git a/src/sbbs3/zmodem.c b/src/sbbs3/zmodem.c index 145a5b847151fd5047f7f789cf282307e5944181..9404df3196cfb700f48e5063a2e5d576cf3c5ea6 100644 --- a/src/sbbs3/zmodem.c +++ b/src/sbbs3/zmodem.c @@ -1379,7 +1379,7 @@ int zmodem_send_from(zmodem_t* zm, FILE* fp, ulong pos, ulong fsize, ulong* sent /* * at end of file wait for an ACK - can't use feof() here! */ - if((ulong)ftell(fp) >= fsize) + if((ulong)ftell(fp) >= fsize || n==0) type = ZCRCW; zmodem_send_data(zm, type, zm->tx_data_subpacket, n); @@ -1407,6 +1407,11 @@ int zmodem_send_from(zmodem_t* zm, FILE* fp, ulong pos, ulong fsize, ulong* sent lprintf(zm,LOG_DEBUG,"zmodem_send_from: end of file (%ld)", fsize ); return ZACK; } + if(n==0) { + lprintf(zm,LOG_DEBUG,"zmodem_send_from: read error at offset %lu", ftell(fp) ); + return ZACK; + } + } /*