[xmlsec] fix %d - Coverity complains (Simo Sorce, Red Hat)
- From: Aleksey Sanin <aleksey src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [xmlsec] fix %d - Coverity complains (Simo Sorce, Red Hat)
- Date: Wed, 4 Jun 2014 17:03:49 +0000 (UTC)
commit d92f1eee02c1321aafdd158845df591b3b91255c
Author: Aleksey Sanin <aleksey aleksey com>
Date: Wed Jun 4 09:25:50 2014 -0700
fix %d - Coverity complains (Simo Sorce, Red Hat)
apps/cmdline.c | 4 ++--
src/base64.c | 2 +-
src/buffer.c | 2 +-
src/dl.c | 2 +-
src/io.c | 2 +-
src/keyinfo.c | 2 +-
src/keys.c | 4 ++--
src/keysmngr.c | 2 +-
src/list.c | 4 ++--
src/nodeset.c | 2 +-
src/transforms.c | 6 +++---
src/xmldsig.c | 4 ++--
src/xmlenc.c | 2 +-
src/xpath.c | 4 ++--
14 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/apps/cmdline.c b/apps/cmdline.c
index b9ecafb..eb95d9a 100644
--- a/apps/cmdline.c
+++ b/apps/cmdline.c
@@ -152,7 +152,7 @@ xmlSecAppCmdLineValueCreate(xmlSecAppCmdLineParamPtr param, int pos) {
assert(param != NULL);
value = (xmlSecAppCmdLineValuePtr) malloc(sizeof(xmlSecAppCmdLineValue));
if(value == NULL) {
- fprintf(stderr, "Error: malloc failed (%d bytes).\n", sizeof(xmlSecAppCmdLineValue));
+ fprintf(stderr, "Error: malloc failed (%d bytes).\n", (int)sizeof(xmlSecAppCmdLineValue));
return(NULL);
}
memset(value, 0, sizeof(xmlSecAppCmdLineValue));
@@ -284,7 +284,7 @@ xmlSecAppCmdLineParamRead(xmlSecAppCmdLineParamPtr param, const char** argv, int
value->strValue = argv[++pos];
buf = (char*)malloc(strlen(value->strValue) + 2);
if(buf == NULL) {
- fprintf(stderr, "Error: failed to allocate memory (%d bytes).\n", strlen(value->strValue) +
2);
+ fprintf(stderr, "Error: failed to allocate memory (%d bytes).\n",
(int)strlen(value->strValue) + 2);
return(-1);
}
memset(buf, 0, strlen(value->strValue) + 2);
diff --git a/src/base64.c b/src/base64.c
index 53e6694..0546582 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -161,7 +161,7 @@ xmlSecBase64CtxCreate(int encode, int columns) {
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecBase64Ctx)=%d",
- sizeof(xmlSecBase64Ctx));
+ (int)sizeof(xmlSecBase64Ctx));
return(NULL);
}
diff --git a/src/buffer.c b/src/buffer.c
index 0efbfed..52c5fc9 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -67,7 +67,7 @@ xmlSecBufferCreate(xmlSecSize size) {
NULL,
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
- "sizeof(xmlSecBuffer)=%d", sizeof(xmlSecBuffer));
+ "sizeof(xmlSecBuffer)=%d", (int)sizeof(xmlSecBuffer));
return(NULL);
}
diff --git a/src/dl.c b/src/dl.c
index 5ffc2ff..255818f 100644
--- a/src/dl.c
+++ b/src/dl.c
@@ -102,7 +102,7 @@ xmlSecCryptoDLLibraryCreate(const xmlChar* name) {
NULL,
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
- "size=%d", sizeof(lib));
+ "size=%d", (int)sizeof(lib));
return(NULL);
}
memset(lib, 0, sizeof(xmlSecCryptoDLLibrary));
diff --git a/src/io.c b/src/io.c
index 42e9133..3f3b9ef 100644
--- a/src/io.c
+++ b/src/io.c
@@ -66,7 +66,7 @@ xmlSecIOCallbackCreate(xmlInputMatchCallback matchFunc, xmlInputOpenCallback ope
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecIOCallback)=%d",
- sizeof(xmlSecIOCallback));
+ (int)sizeof(xmlSecIOCallback));
return(NULL);
}
memset(callbacks, 0, sizeof(xmlSecIOCallback));
diff --git a/src/keyinfo.c b/src/keyinfo.c
index 61ef2bb..7fc6a4b 100644
--- a/src/keyinfo.c
+++ b/src/keyinfo.c
@@ -227,7 +227,7 @@ xmlSecKeyInfoCtxCreate(xmlSecKeysMngrPtr keysMngr) {
NULL,
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
- "size=%d", sizeof(xmlSecKeyInfoCtx));
+ "size=%d", (int)sizeof(xmlSecKeyInfoCtx));
return(NULL);
}
diff --git a/src/keys.c b/src/keys.c
index 1d2f733..27f3690 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -112,7 +112,7 @@ xmlSecKeyUseWithCreate(const xmlChar* application, const xmlChar* identifier) {
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecKeyUseWith)=%d",
- sizeof(xmlSecKeyUseWith));
+ (int)sizeof(xmlSecKeyUseWith));
return(NULL);
}
memset(keyUseWith, 0, sizeof(xmlSecKeyUseWith));
@@ -548,7 +548,7 @@ xmlSecKeyCreate(void) {
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecKey)=%d",
- sizeof(xmlSecKey));
+ (int)sizeof(xmlSecKey));
return(NULL);
}
memset(key, 0, sizeof(xmlSecKey));
diff --git a/src/keysmngr.c b/src/keysmngr.c
index 31a03e9..ad253c9 100644
--- a/src/keysmngr.c
+++ b/src/keysmngr.c
@@ -53,7 +53,7 @@ xmlSecKeysMngrCreate(void) {
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecKeysMngr)=%d",
- sizeof(xmlSecKeysMngr));
+ (int)sizeof(xmlSecKeysMngr));
return(NULL);
}
memset(mngr, 0, sizeof(xmlSecKeysMngr));
diff --git a/src/list.c b/src/list.c
index d1a0053..1d48cc6 100644
--- a/src/list.c
+++ b/src/list.c
@@ -65,7 +65,7 @@ xmlSecPtrListCreate(xmlSecPtrListId id) {
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecPtrList)=%d",
- sizeof(xmlSecPtrList));
+ (int)sizeof(xmlSecPtrList));
return(NULL);
}
@@ -479,7 +479,7 @@ xmlSecPtrListEnsureSize(xmlSecPtrListPtr list, xmlSecSize size) {
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecPtr)*%d=%d",
- newSize, sizeof(xmlSecPtr) * newSize);
+ newSize, (int)(sizeof(xmlSecPtr) * newSize));
return(-1);
}
diff --git a/src/nodeset.c b/src/nodeset.c
index 04ae810..fbb3ecd 100644
--- a/src/nodeset.c
+++ b/src/nodeset.c
@@ -57,7 +57,7 @@ xmlSecNodeSetCreate(xmlDocPtr doc, xmlNodeSetPtr nodes, xmlSecNodeSetType type)
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecNodeSet)=%d",
- sizeof(xmlSecNodeSet));
+ (int)sizeof(xmlSecNodeSet));
return(NULL);
}
memset(nset, 0, sizeof(xmlSecNodeSet));
diff --git a/src/transforms.c b/src/transforms.c
index eda21c7..d384a0e 100644
--- a/src/transforms.c
+++ b/src/transforms.c
@@ -355,7 +355,7 @@ xmlSecTransformCtxCreate(void) {
NULL,
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
- "size=%d", sizeof(xmlSecTransformCtx));
+ "size=%d", (int)sizeof(xmlSecTransformCtx));
return(NULL);
}
@@ -876,7 +876,7 @@ xmlSecTransformCtxSetUri(xmlSecTransformCtxPtr ctx, const xmlChar* uri, xmlNodeP
NULL,
NULL,
XMLSEC_ERRORS_R_STRDUP_FAILED,
- "size=%d", xptr - uri);
+ "size=%d", (int)(xptr - uri));
return(-1);
}
@@ -2816,7 +2816,7 @@ xmlSecTransformIOBufferCreate(xmlSecTransformIOBufferMode mode, xmlSecTransformP
NULL,
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
- "size=%d", sizeof(xmlSecTransformIOBuffer));
+ "size=%d", (int)sizeof(xmlSecTransformIOBuffer));
return(NULL);
}
memset(buffer, 0, sizeof(xmlSecTransformIOBuffer));
diff --git a/src/xmldsig.c b/src/xmldsig.c
index ad61042..bf9a85b 100644
--- a/src/xmldsig.c
+++ b/src/xmldsig.c
@@ -73,7 +73,7 @@ xmlSecDSigCtxCreate(xmlSecKeysMngrPtr keysMngr) {
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecDSigCtx)=%d",
- sizeof(xmlSecDSigCtx));
+ (int)sizeof(xmlSecDSigCtx));
return(NULL);
}
@@ -1278,7 +1278,7 @@ xmlSecDSigReferenceCtxCreate(xmlSecDSigCtxPtr dsigCtx, xmlSecDSigReferenceOrigin
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecDSigReferenceCtx)=%d",
- sizeof(xmlSecDSigReferenceCtx));
+ (int)sizeof(xmlSecDSigReferenceCtx));
return(NULL);
}
diff --git a/src/xmlenc.c b/src/xmlenc.c
index 44c9877..0480159 100644
--- a/src/xmlenc.c
+++ b/src/xmlenc.c
@@ -65,7 +65,7 @@ xmlSecEncCtxCreate(xmlSecKeysMngrPtr keysMngr) {
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecEncCtx)=%d",
- sizeof(xmlSecEncCtx));
+ (int)sizeof(xmlSecEncCtx));
return(NULL);
}
diff --git a/src/xpath.c b/src/xpath.c
index e67631e..34ce285 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -91,7 +91,7 @@ xmlSecXPathDataCreate(xmlSecXPathDataType type) {
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"sizeof(xmlSecXPathData)=%d",
- sizeof(xmlSecXPathData));
+ (int)sizeof(xmlSecXPathData));
return(NULL);
}
memset(data, 0, sizeof(xmlSecXPathData));
@@ -613,7 +613,7 @@ xmlSecTransformXPathNodeRead(xmlSecTransformPtr transform, xmlNodePtr node, xmlS
NULL,
XMLSEC_ERRORS_R_MALLOC_FAILED,
"size=%d",
- xmlStrlen(data->expr) + strlen(xpathPattern) + 1);
+ (int)(xmlStrlen(data->expr) + strlen(xpathPattern) + 1));
return(-1);
}
sprintf((char*)tmp, xpathPattern, (char*)data->expr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]