From 2c6f0581ac927a35a411ac1fe9068d6df947054d Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 4 Jun 2020 22:54:38 -0700 Subject: [PATCH] A couple minor fixes. --- clientserver.c | 4 ++-- main.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/clientserver.c b/clientserver.c index 8df14947..91f78b7b 100644 --- a/clientserver.c +++ b/clientserver.c @@ -1173,7 +1173,7 @@ static void create_pid_file(void) fail = "lock"; else if (do_fstat(pid_file_fd, &st1) < 0) fail = "fstat opened"; - else if (st1.st_size >= (int)sizeof pidbuf) + else if (st1.st_size > (int)sizeof pidbuf) fail = "find small"; else if (do_lstat(pid_file, &st2) < 0) fail = "lstat"; @@ -1190,7 +1190,7 @@ static void create_pid_file(void) int len = snprintf(pidbuf, sizeof pidbuf, "%d\n", (int)pid); #ifndef HAVE_FTRUNCATE /* What can we do with a too-long file and no truncate? I guess we'll add extra newlines. */ - while (len < st1.st_size) /* We already verified that st_size+1 chars fits in the buffer. */ + while (len < st1.st_size) /* We already verified that st_size chars fits in the buffer. */ pidbuf[len++] = '\n'; /* We don't need the buffer to end in a '\0' (and we may not have room to add it). */ #endif diff --git a/main.c b/main.c index ed1a210f..98bbaa68 100644 --- a/main.c +++ b/main.c @@ -88,7 +88,6 @@ extern char *partial_dir; extern char *dest_option; extern char *rsync_path; extern char *shell_cmd; -extern char *batch_name; extern char *password_file; extern char *backup_dir; extern char *copy_as; -- 2.47.2