commit 142d26f8d481f061e6b6cb128ceacb9002479466
parent 0fb8df381a5af6c001840c17aec91c3e20b730d6
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Tue, 5 Jan 2021 19:18:07 -0800
Fix wstrtonum() ordering
Diffstat:
M | util.c | | | 22 | +++++++++++----------- |
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/util.c b/util.c
@@ -102,6 +102,17 @@ wremove(char const *path)
return 0;
}
+long long
+wstrtonum(const char *ns, long long min, long long max, const char **err)
+{
+ long long n;
+
+ n = strtonum(ns, min, max, err);
+ if (*err != NULL)
+ warn(0, "number '%s': %s", ns, *err);
+ return n;
+}
+
void
tr(char *r, char const *s, int orig, int repl)
{
@@ -127,14 +138,3 @@ warn(int error, char const *format, ...)
fprintf(stderr, ": %s", strerror(error));
fputc('\n', stderr);
}
-
-long long
-wstrtonum(const char *ns, long long min, long long max, const char **err)
-{
- long long n;
-
- n = strtonum(ns, min, max, err);
- if (*err != NULL)
- warn(0, "number '%s': %s", ns, *err);
- return n;
-}