fix counting of elements in array. Just typo, as I think.
if (!(netem = rtnl_tc_data(TC_CAST(qdisc))))
BUG();
- FILE *f = NULL;
+ FILE *f;
int i, n = 0;
size_t len = 2048;
char *line;
/* Check several locations for the dist file */
char *test_path[] = { "", "./", "/usr/lib/tc/", "/usr/local/lib/tc/" };
- for (i = 0; i < sizeof(test_path) && f == NULL; i++) {
+ for (i = 0; i < sizeof(test_path)/sizeof(test_path[0]); i++) {
snprintf(name, NAME_MAX, "%s%s%s", test_path[i], dist_type, dist_suffix);
- f = fopen(name, "r");
+ if ((f = fopen(name, "r")))
+ break;
}
if ( f == NULL )