Fix write check.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 12 Aug 2010 15:54:54 +0000 (15:54 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 12 Aug 2010 15:54:54 +0000 (15:54 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4179 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/net/xmodem.c

index ce8d038e365a5d2fce412c1ca1c5366d2c38b195..fbf43386d151d757d690d14b4563c12438ff241b 100644 (file)
@@ -268,7 +268,7 @@ bool xmodem_recv(KFile *ch, KFile *fd)
                        if (last_block_done < blocknr)
                        {
                                /* Call user function to flush the buffer */
-                               if (kfile_write(fd, block_buffer, blocksize))
+                               if (kfile_write(fd, block_buffer, blocksize) == (size_t)blocksize)
                                {
                                        /* Acknowledge block and clear error counter */
                                        kfile_putc(XM_ACK, ch);