search for: prevchar

Displaying 2 results from an estimated 2 matches for "prevchar".

Did you mean: preacher
2013 Aug 22
2
[PATCH] tftp-hpa: add error check for disk filled up
...00644 --- a/common/tftpsubs.c +++ b/common/tftpsubs.c @@ -206,20 +206,22 @@ int write_behind(FILE * file, int convert) p = buf; ct = count; + count = 0; while (ct--) { /* loop over the buffer */ c = *p++; /* pick up a character */ if (prevchar == '\r') { /* if prev char was cr */ if (c == '\n') /* if have cr,lf then just */ - fseek(file, -1, 1); /* smash lf on top of the cr */ + count = count - 1; else if (c == '\0') /* if have cr,nul then */...
2013 Sep 03
1
[PATCH v2] tftp-hpa: add error check for disk filled up
...bs.c @@ -215,7 +215,9 @@ int write_behind(FILE * file, int convert) goto skipit; /* just skip over the putc */ /* else just fall through and allow it */ } - putc(c, file); + if (putc(c, file) == EOF) { + return -1; + } skipit: prevchar = c; } diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c index 1873e70..c2adbda 100644 --- a/tftpd/tftpd.c +++ b/tftpd/tftpd.c @@ -1681,7 +1681,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac syslog(LOG_WARNING, "tftpd: write(ack): %m");...