Remove warnings

This commit is contained in:
Zhi Guan
2022-10-13 17:45:06 +08:00
parent 53cb1fbee0
commit 5e2381f122
19 changed files with 43 additions and 44 deletions

View File

@@ -536,8 +536,8 @@ int skf_import_object(SKF_DEVICE *dev, const char *appname, const char *pin,
error_print();
return -1;
}
if (SKF_CreateFile(hApp, (LPSTR)objname, datalen, ulReadRights, ulWriteRights) != SAR_OK
|| SKF_WriteFile(hApp, (LPSTR)objname, 0, (BYTE *)data, datalen) != SAR_OK) {
if (SKF_CreateFile(hApp, (LPSTR)objname, (ULONG)datalen, ulReadRights, ulWriteRights) != SAR_OK
|| SKF_WriteFile(hApp, (LPSTR)objname, 0, (BYTE *)data, (ULONG)datalen) != SAR_OK) {
error_print();
goto end;
}
@@ -554,7 +554,6 @@ int skf_export_object(SKF_DEVICE *dev, const char *appname, const char *pin,
HAPPLICATION hApp = NULL;
FILEATTRIBUTE fileInfo;
ULONG ulen;
int len;
if (!dev || !appname || !pin || !objname || !outlen) {
error_print();

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
/*
* Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
#include <stdio.h>
#include <stdlib.h>
@@ -434,7 +434,7 @@ ULONG DEVAPI SKF_ExportCertificate(
BYTE *pbCert,
ULONG *pulCertLen)
{
*pulCertLen = strlen(sm2cert_pemstr);
*pulCertLen = (ULONG)strlen(sm2cert_pemstr);
memcpy(pbCert, sm2cert_pemstr, *pulCertLen);
return SAR_OK;