From ab3d77418c79a735981227cd6fc203dd9590e3a7 Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Wed, 2 Oct 2024 15:18:01 +0200 Subject: [PATCH] Don't seek fd if no -S was specified --- tftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tftp.c b/tftp.c index 04509aa..57e65a8 100644 --- a/tftp.c +++ b/tftp.c @@ -359,7 +359,7 @@ ssize_t tftp_put(struct nmrpd_args *args) file_remote = args->file_local; } - if (lseek(fd, args->offset, SEEK_SET) == (off_t)-1) { + if (args->offset && (lseek(fd, args->offset, SEEK_SET) == (off_t)-1)) { xperror("lseek"); goto cleanup; }