Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Prefer testing line[0] != '\0' over calling strlen()
Baptiste Daroussin committed 13 years ago
commit a855c8f1e718e57f5f4f973df0b20b5168afa95a
parent 272fd2a
1 file changed +1 -1
modified libpkg/pkg_ports.c
@@ -411,7 +411,7 @@ comment_key(struct plist *p, char *line, struct file_attr *a)
		if (line[0] != '\0') {
			line_options = strdup(line);
			while ((option = strsep(&line_options, " ")) != NULL) {
-
				if (strlen(option) > 0)
+
				if (option[0] != '\0')
					pkg_addoption(p->pkg, option + 1,
					    option[0] == '+' ? "on" : "off");
			}