diff --git a/src/cfg.c b/lib/cfg.c similarity index 100% rename from src/cfg.c rename to lib/cfg.c diff --git a/src/hist.c b/lib/hist.c similarity index 100% rename from src/hist.c rename to lib/hist.c diff --git a/src/hooks.c b/lib/hooks.c similarity index 99% rename from src/hooks.c rename to lib/hooks.c index 4e21b5368..02eb639b7 100644 --- a/src/hooks.c +++ b/lib/hooks.c @@ -146,6 +146,7 @@ int hook_fir(struct path *p, struct hook *h, int when) { /** @todo make this configurable via hook parameters */ const static double coeffs[] = HOOK_FIR_COEFFS; + char *end; struct private { double *coeffs; @@ -163,8 +164,8 @@ int hook_fir(struct path *p, struct hook *h, int when) private->coeffs = memdup(coeffs, sizeof(coeffs)); private->history = alloc(sizeof(coeffs)); - private->index = strtol(h->parameter, NULL, 10); - if (!private->index) + private->index = strtol(h->parameter, &end, 10); + if (errno == EINVAL || errno == ERANGE) error("Invalid parameter '%s' for hook 'fir'", h->parameter); break; diff --git a/src/path.c b/lib/path.c similarity index 100% rename from src/path.c rename to lib/path.c diff --git a/src/timing.c b/lib/timing.c similarity index 100% rename from src/timing.c rename to lib/timing.c