Skip to content

Commit

Permalink
src: remove dead code in AddFingerprintDigest
Browse files Browse the repository at this point in the history
This function is never called with md_size == 0, and it would make no
sense to do so in the future either.

PR-URL: #42145
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
  • Loading branch information
tniessen authored and danielleadams committed Apr 24, 2022
1 parent 33b11a3 commit 3026449
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/crypto/crypto_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,8 @@ void AddFingerprintDigest(
fingerprint[(3*i)+2] = ':';
}

if (md_size > 0) {
fingerprint[(3*(md_size-1))+2] = '\0';
} else {
fingerprint[0] = '\0';
}
DCHECK_GT(md_size, 0);
fingerprint[(3 * (md_size - 1)) + 2] = '\0';
}

template <const char* (*nid2string)(int nid)>
Expand Down

0 comments on commit 3026449

Please sign in to comment.