#endif /* ENABLE_FEATURE_MODPROBE_MULTIPLE_OPTIONS */
static int is_conf_command(char *buffer, const char *command)
-{
+{
int len = strlen(command);
return ((strstr(buffer, command) == buffer) &&
- isspace(buffer[len]));
+ isspace(buffer[len]));
}
/*
include_conf(first, current, buffer, buflen, fdi);
close(fdi);
}
- } else if (ENABLE_FEATURE_MODPROBE_BLACKLIST &&
+ } else if (ENABLE_FEATURE_MODPROBE_BLACKLIST &&
(is_conf_command(buffer, "blacklist"))) {
char *mod;
struct dep_t *dt;
/* It's a dep description continuation */
p = line_buffer;
- p = skip_whitespace(p);
-
/* p points to the first dependable module; if NULL, no dependable module */
- if (p && *p) {
+ if (p && (p = skip_whitespace(p))[0] != '\0') {
char *end = &line_buffer[l-1];
const char *deps;
char *dep;
dep = xstrndup(deps, next - deps - ext + 1);
/* Add the new dependable module name */
- current->m_depcnt++;
- current->m_deparr = xrealloc(current->m_deparr,
- sizeof(char *) * current->m_depcnt);
- current->m_deparr[current->m_depcnt - 1] = dep;
+ current->m_deparr = xrealloc_vector(current->m_deparr, 2, current->m_depcnt);
+ current->m_deparr[current->m_depcnt++] = dep;
p = next + 2;
} while (next < end);