From 9faf70fc78f0cc7746b14d38b96a98ca904e4dbe Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 15 Oct 2020 18:10:14 +0000 Subject: [PATCH] Remove always-true condition, but be clear that n does not change in this function --- osscan.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osscan.cc b/osscan.cc index 5142c828f..50a7826e2 100644 --- a/osscan.cc +++ b/osscan.cc @@ -489,7 +489,7 @@ void WriteSInfo(char *ostr, int ostrlen, bool isGoodFP, No more than n bytes will be written. Unless n is 0, the string is always null-terminated. Returns the number of bytes written, excluding the terminator. */ -static int test2str(const FingerTest *test, char *s, size_t n) { +static int test2str(const FingerTest *test, char *s, const size_t n) { std::vector::const_iterator av; char *p; char *end; @@ -541,8 +541,7 @@ static int test2str(const FingerTest *test, char *s, size_t n) { return p - s; error: - if (n > 0) - *s = '\0'; + *s = '\0'; return -1; }