Index: head/libexec/tftpd/tftp-file.c =================================================================== --- head/libexec/tftpd/tftp-file.c +++ head/libexec/tftpd/tftp-file.c @@ -110,10 +110,10 @@ { size_t i; static size_t n = 0, in = 0; - static int newline = 0; + static int newline = -1; if (init) { - newline = 0; + newline = -1; n = 0; in = 0; return 0 ; @@ -124,9 +124,9 @@ */ i = 0; - if (newline) { + if (newline != -1) { buffer[i++] = newline; - newline = 0; + newline = -1; } while (i < count) { @@ -161,7 +161,7 @@ if (i > count) { /* - * Whoops... that isn't alllowed (but it will happen + * Whoops... that isn't allowed (but it will happen * when there is a CR or LF at the end of the buffer) */ newline = buffer[i-1];