Module: wine Branch: master Commit: e141d4a1c6e3d7ee8f9272e39e9200aefa78404e URL: http://source.winehq.org/git/wine.git/?a=commit;h=e141d4a1c6e3d7ee8f9272e39e...
Author: Carlo Bramini carlo.bramix@libero.it Date: Sat Nov 12 10:07:12 2016 +0100
wintrust: Use return value of sprintf() instead of calling strlen().
Signed-off-by: Carlo Bramini carlo_bramini@users.sourceforge.net Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wintrust/asn.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/wintrust/asn.c b/dlls/wintrust/asn.c index 778123e..035a59a 100644 --- a/dlls/wintrust/asn.c +++ b/dlls/wintrust/asn.c @@ -1894,10 +1894,9 @@ static BOOL WINAPI CRYPT_AsnDecodeOidIgnoreTag(DWORD dwCertEncodingType, LPSTR pszObjId = *(LPSTR *)pvStructInfo;
*pszObjId = 0; - sprintf(pszObjId, "%d.%d", pbEncoded[1 + lenBytes] / 40, + pszObjId += sprintf(pszObjId, "%d.%d", pbEncoded[1 + lenBytes] / 40, pbEncoded[1 + lenBytes] - (pbEncoded[1 + lenBytes] / 40) * 40); - pszObjId += strlen(pszObjId); for (ptr = pbEncoded + 2 + lenBytes; ret && ptr - pbEncoded - 1 - lenBytes < dataLen; ) { @@ -1912,8 +1911,7 @@ static BOOL WINAPI CRYPT_AsnDecodeOidIgnoreTag(DWORD dwCertEncodingType, } val <<= 7; val |= *ptr++; - sprintf(pszObjId, ".%d", val); - pszObjId += strlen(pszObjId); + pszObjId += sprintf(pszObjId, ".%d", val); } } else