mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Increase header size for ymodem
This commit is contained in:
parent
a42f3f78d1
commit
838c110876
1 changed files with 4 additions and 2 deletions
|
|
@ -202,11 +202,13 @@ int xymodem_send(int sio, const char *filename, char mode)
|
|||
else {
|
||||
/* Ymodem: hdr + file + fin */
|
||||
while(1) {
|
||||
char hdr[128], *p;
|
||||
char hdr[1024], *p;
|
||||
|
||||
rc = -1;
|
||||
if (strlen(filename) > 977) break; /* hdr block overrun */
|
||||
p = stpcpy(hdr, filename) + 1;
|
||||
p += sprintf(p, "%ld %lo %o", len, stat.st_mtime, stat.st_mode);
|
||||
|
||||
rc = -1;
|
||||
if (xmodem(sio, hdr, p - hdr, 0) < 0) break; /* hdr with metadata */
|
||||
if (xmodem(sio, buf, len, 1) < 0) break; /* xmodem file */
|
||||
if (xmodem(sio, "", 1, 0) < 0) break; /* empty hdr = fin */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue