Correctly transmit empty file
authorJoseph C. Lehner <joseph.c.lehner@gmail.com>
Sun, 7 Feb 2016 21:14:04 +0000 (22:14 +0100)
committerJoseph C. Lehner <joseph.c.lehner@gmail.com>
Sun, 7 Feb 2016 21:14:04 +0000 (22:14 +0100)
tftp.c

diff --git a/tftp.c b/tftp.c
index 89d98c0c154a1a16539f627a970183cc78cda4cd..f0f0457b8525e4cfaff4f95cd37bc9b8b44879cb 100644 (file)
--- a/tftp.c
+++ b/tftp.c
@@ -272,7 +272,7 @@ int tftp_put(struct nmrpd_args *args)
                                        ret = len;
                                        goto cleanup;
                                } else if (!len) {
-                                       if (last_len != 512) {
+                                       if (last_len != 512 && last_len != -1) {
                                                break;
                                        }
                                }