strlcpy() (and OPENSSL_strlcpy() after it) returns the length
of the input string as a result, don't throw it away just to calculate
it once again on return.
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
MergeDate: Tue May 26 08:58:27 2026
(Merged from https://github.com/openssl/openssl/pull/31226)
s = OBJ_nid2sn(nid);
if (s != NULL) {
if (buf != NULL)
- OPENSSL_strlcpy(buf, s, buf_len);
+ return (int)OPENSSL_strlcpy(buf, s, buf_len);
return (int)strlen(s);
}
}