Print this page
11200 cpcgen needs smatch fixes again
@@ -8,11 +8,11 @@
* source. A copy of the CDDL is also available via the Internet at
* http://www.illumos.org/license/CDDL.
*/
/*
- * Copyright (c) 2019, Joyent, Inc.
+ * Copyright 2019, Joyent, Inc.
*/
/*
* This program transforms Intel perfmon and AMD PMC data files into C files and
* manual pages.
@@ -417,17 +417,17 @@
brand, bstr);
}
errno = 0;
l = strtol(fam, &last, 16);
- if (errno != 0 || l < 0 || l > UINT_MAX || *last != '\0') {
+ if (errno != 0 || l < 0 || l >= INT_MAX || *last != '\0') {
errx(EXIT_FAILURE, "failed to parse family \"%s\"", fam);
}
*family = (uint_t)l;
l = strtol(mod, &last, 16);
- if (errno != 0 || l < 0 || l > UINT_MAX || *last != '\0') {
+ if (errno != 0 || l < 0 || l >= INT_MAX || *last != '\0') {
errx(EXIT_FAILURE, "failed to parse model \"%s\"", mod);
}
*model = (uint_t)l;
if (step == NULL) {
@@ -890,11 +890,10 @@
warn("failed to write out manual header for %s",
map->cmap_name);
return (B_FALSE);
}
- free(upper);
return (B_TRUE);
}
static boolean_t
cpcgen_manual_intel_file_after(FILE *f, cpc_map_t *map)