package

simple and robust package manager
Log | Files | Refs | README

commit c056d58afc6605bfbfa034b14d62d38995c81d64
parent cb72f0ce1211844241aeb99eae7ba529d06c3a91
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 22 Jan 2019 00:25:14 +0100

fix initialization of package_scan

Diffstat:
Mpackage.c | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/package.c b/package.c @@ -155,6 +155,8 @@ package_scan(package *p, char const *s, size_t n) if (s[0] == '/') return 0; + mem_zero((char *)p, sizeof *p); + for (i = 0; i < n; ++i, ++x) { if (!isprint(s[i]) || s[i] == ' ') goto end; if (s[i] == '/') { ++i; break; } @@ -169,11 +171,6 @@ package_scan(package *p, char const *s, size_t n) p->ver[y] = s[i]; } end: - p->dep_build = 0; - p->dep_run = 0; - p->dep_lib = 0; - p->name[x] = '\0'; - p->ver[y] = '\0'; return i; }