diff options
| author | David E. O'Brien <obrien@FreeBSD.org> | 2002-08-31 18:45:32 +0000 |
|---|---|---|
| committer | David E. O'Brien <obrien@FreeBSD.org> | 2002-08-31 18:45:32 +0000 |
| commit | bc8118e19de95eb65498baf5354d3545e420289e (patch) | |
| tree | e838ea041bc93a40dd52b75cde5cfc2fc9a7924b | |
| parent | 54074ba97895352857f33abaef5cbb6f82290c78 (diff) | |
Notes
| -rw-r--r-- | usr.sbin/pkg_install/add/extract.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/add/extract.c b/usr.sbin/pkg_install/add/extract.c index 65747f53fcfe..83f46e312c99 100644 --- a/usr.sbin/pkg_install/add/extract.c +++ b/usr.sbin/pkg_install/add/extract.c @@ -159,7 +159,7 @@ extract_plist(const char *home, Package *pkg) PUSHOUT(Directory); } add_count = snprintf(&perm_args[perm_count], maxargs - perm_count, "'%s' ", p->name); - if (add_count > maxargs - perm_count) { + if (add_count < 0 || add_count > maxargs - perm_count) { cleanup(0); errx(2, "%s: oops, miscounted strings!", __func__); } @@ -179,7 +179,7 @@ extract_plist(const char *home, Package *pkg) PUSHOUT(Directory); } add_count = snprintf(&where_args[where_count], maxargs - where_count, " '%s'", p->name); - if (add_count > maxargs - where_count) { + if (add_count < 0 || add_count > maxargs - where_count) { cleanup(0); errx(2, "%s: oops, miscounted strings!", __func__); } @@ -187,7 +187,7 @@ extract_plist(const char *home, Package *pkg) add_count = snprintf(&perm_args[perm_count], maxargs - perm_count, "'%s' ", p->name); - if (add_count > maxargs - perm_count) { + if (add_count < 0 || add_count > maxargs - perm_count) { cleanup(0); errx(2, "%s: oops, miscounted strings!", __func__); } |
