Skip to content

Commit

Permalink
Don't seek fd if no -S <offset> was specified
Browse files Browse the repository at this point in the history
  • Loading branch information
jclehner committed Oct 2, 2024
1 parent 904479b commit ab3d774
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ab3d774

Please sign in to comment.