Skip to content
Snippets Groups Projects
Commit e1b5f1a7 authored by rswindell's avatar rswindell
Browse files

Adjust file position for bytes already sent successfully in zmodem_send_file().

parent bb03ff31
No related branches found
No related tags found
No related merge requests found
...@@ -1671,8 +1671,10 @@ BOOL zmodem_send_file(zmodem_t* zm, char* fname, FILE* fp, BOOL request_init, ti ...@@ -1671,8 +1671,10 @@ BOOL zmodem_send_file(zmodem_t* zm, char* fname, FILE* fp, BOOL request_init, ti
if(type == ZFERR || type == ZABORT || zm->cancelled) if(type == ZFERR || type == ZABORT || zm->cancelled)
return(FALSE); return(FALSE);
if(sent!=NULL) if(sent != NULL)
*sent+=sent_bytes; *sent += sent_bytes;
pos += sent_bytes;
if(type == ZACK) /* success */ if(type == ZACK) /* success */
break; break;
...@@ -1772,9 +1774,10 @@ int zmodem_recv_files(zmodem_t* zm, const char* download_dir, ulong* bytes_recei ...@@ -1772,9 +1774,10 @@ int zmodem_recv_files(zmodem_t* zm, const char* download_dir, ulong* bytes_recei
break; break;
} }
if((fp=fopen(fpath,"rb"))==NULL) { if((fp=fopen(fpath,"rb"))==NULL) {
lprintf(zm,LOG_ERR,"Error %d opening %s",errno,fpath); lprintf(zm,LOG_ERR,"Error %d opening %s", errno, fpath);
break; break;
} }
lprintf(zm,LOG_INFO,"Calculating CRC of %s", fpath);
crc=fcrc32(fp,l); crc=fcrc32(fp,l);
fclose(fp); fclose(fp);
if(!zmodem_get_crc(zm,l,&rcrc)) { if(!zmodem_get_crc(zm,l,&rcrc)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment