mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Remove always-true condition, but be clear that n does not change in this function
This commit is contained in:
@@ -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<struct AVal>::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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user