Mercurial > illumos > git > illumos-omnios
changeset 21430:a983baf303af
11200 cpcgen needs smatch fixes again
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Approved by: Dan McDonald <danmcd@joyent.com>
author | John Levon <john.levon@joyent.com> |
---|---|
date | Wed, 05 Jun 2019 03:13:11 -0700 |
parents | 01a16a874588 |
children | 2a556bd9a733 |
files | usr/src/tools/cpcgen/cpcgen.c |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/tools/cpcgen/cpcgen.c Thu May 30 22:06:01 2019 +0300 +++ b/usr/src/tools/cpcgen/cpcgen.c Wed Jun 05 03:13:11 2019 -0700 @@ -10,7 +10,7 @@ */ /* - * Copyright (c) 2019, Joyent, Inc. + * Copyright 2019, Joyent, Inc. */ /* @@ -419,13 +419,13 @@ 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; @@ -892,7 +892,6 @@ return (B_FALSE); } - free(upper); return (B_TRUE); }