From e7df392754fac1f9fa1d2971254478d1e5997f21 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 13 Dec 2015 20:30:16 +0100 Subject: [PATCH] moved source files to lib directory --- {src => lib}/cfg.c | 0 {src => lib}/hist.c | 0 {src => lib}/hooks.c | 5 +++-- {src => lib}/path.c | 0 {src => lib}/timing.c | 0 5 files changed, 3 insertions(+), 2 deletions(-) rename {src => lib}/cfg.c (100%) rename {src => lib}/hist.c (100%) rename {src => lib}/hooks.c (99%) rename {src => lib}/path.c (100%) rename {src => lib}/timing.c (100%) 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