sw-collector: Cast chunk length to int when printing as string

This commit is contained in:
Tobias Brunner
2017-08-08 15:31:56 +02:00
parent 0392f76804
commit cbade9b6b9
+6 -6
View File
@@ -147,9 +147,9 @@ sw_collector_info_t *sw_collector_info_create(char *tag_creator)
} }
/* construct OS string */ /* construct OS string */
if (asprintf(&this->os, "%.*s_%.*s-%.*s", os_name.len, os_name.ptr, if (asprintf(&this->os, "%.*s_%.*s-%.*s", (int)os_name.len, os_name.ptr,
os_version.len, os_version.ptr, (int)os_version.len, os_version.ptr, (int)os_arch.len,
os_arch.len, os_arch.ptr) == -1) os_arch.ptr) == -1)
{ {
DBG1(DBG_IMC, "constructon of OS string failed"); DBG1(DBG_IMC, "constructon of OS string failed");
destroy(this); destroy(this);
@@ -157,9 +157,9 @@ sw_collector_info_t *sw_collector_info_create(char *tag_creator)
} }
/* construct product string */ /* construct product string */
if (asprintf(&this->product, "%.*s %.*s %.*s", os_name.len, os_name.ptr, if (asprintf(&this->product, "%.*s %.*s %.*s", (int)os_name.len,
os_version.len, os_version.ptr, os_name.ptr, (int)os_version.len, os_version.ptr,
os_arch.len, os_arch.ptr) == -1) (int)os_arch.len, os_arch.ptr) == -1)
{ {
DBG1(DBG_IMC, "constructon of product string failed"); DBG1(DBG_IMC, "constructon of product string failed");
destroy(this); destroy(this);