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 <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
tniessen authored and sxa committed Mar 7, 2022
1 parent f21fbee commit ce40927
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 ce40927

Please sign in to comment.