pos = memchr(os_version.ptr, ' ', os_version.len);
os_version_len = pos ? (pos - os_version.ptr) : os_version.len;
product = malloc(os_name.len + 1 + os_version_len + 1);
- sprintf(product, "%.*s %.*s", os_name.len, os_name.ptr,
- os_version_len, os_version.ptr);
+ sprintf(product, "%.*s %.*s", (int)os_name.len, os_name.ptr,
+ (int)os_version_len, os_version.ptr);
}
DBG1(DBG_IMV, "processing installed '%s' packages", product);
}
}
e->destroy(e);
-
+
if (found)
{
if (match)
/* OS info is a concatenation of OS name and OS version */
free(this->info);
this->info = malloc(len);
- snprintf(this->info, len, "%.*s %.*s", name.len, name.ptr,
- version.len, version.ptr);
+ snprintf(this->info, len, "%.*s %.*s", (int)name.len, name.ptr,
+ (int)version.len, version.ptr);
this->type = type;
this->name = chunk_clone(name);
this->version = chunk_clone(version);
char* months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
int i;
-
+
if (sscanf(line, "Generated: %3s %3s %2d %2d:%2d:%2d %4d UTC", wday, mon,
&t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec, &t.tm_year) != 7)
{
return UNDEFINED_TIME;
}
- t.tm_isdst = 0;
+ t.tm_isdst = 0;
t.tm_year -= 1900;
t.tm_mon = 12;
e->destroy(e);
}
if (!pid)
- {
+ {
if (db->execute(db, &pid, "INSERT INTO products (name) VALUES (?)",
DB_TEXT, product) != 1)
{
pos = strchr(line, ' ');
if (!pos)
{
- fprintf(stderr, "could not extract package name from '%.*s'",
- strlen(line)-1, line);
+ fprintf(stderr, "could not extract package name from '%.*s'\n",
+ (int)(strlen(line)-1), line);
errored++;
continue;
}
}
else
{
- fprintf(stderr, "could not extract package version from '%.*s'\n",
- strlen(line)-1, line);
+ fprintf(stderr, "could not extract package version from "
+ "'%.*s'\n", (int)(strlen(line)-1), line);
errored++;
continue;
}
e->destroy(e);
}
if (!gid && security)
- {
+ {
if (db->execute(db, &gid, "INSERT INTO packages (name) VALUES (?)",
DB_TEXT, package) != 1)
{
}
/* check for package versions already in database */
- e = db->query(db,
+ e = db->query(db,
"SELECT id, release, security, time FROM versions "
"WHERE package = ? AND product = ?",
DB_INT, gid, DB_INT, pid, DB_INT, DB_TEXT, DB_INT, DB_INT);
}
if ((!vid && security) || (vid && !vid_update))
- {
+ {
printf("%s (%s) %s\n", package, version, security ? "[s]" : "");
if (db->execute(db, &vid,
/* platform info is a concatenation of OS name and OS version */
free(this->platform_info);
this->platform_info = malloc(len);
- snprintf(this->platform_info, len, "%.*s %.*s", name.len, name.ptr,
- version.len, version.ptr);
+ snprintf(this->platform_info, len, "%.*s %.*s", (int)name.len, name.ptr,
+ (int)version.len, version.ptr);
}
METHOD(pts_t, get_tpm_version_info, bool,