summaryrefslogtreecommitdiff
path: root/rcm-server-keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'rcm-server-keymap.c')
-rw-r--r--rcm-server-keymap.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/rcm-server-keymap.c b/rcm-server-keymap.c
index 15b7fe8..56e17f6 100644
--- a/rcm-server-keymap.c
+++ b/rcm-server-keymap.c
@@ -11,7 +11,6 @@
#include <unistd.h>
#include <ctype.h>
#include <errno.h>
-#include <limits.h>
#include "utils.h"
#include "shared.h"
@@ -37,60 +36,6 @@ struct inis iniss[] = {
{ .name = NULL, .value = INI_SECTION_UNDEFINED },
};
-static int strtol_strict(const char *str, int *result)
-{
- char *end;
- long val;
-
- errno = 0;
- val = strtol(str, &end, 10);
-
- if (errno == ERANGE && (val == LONG_MAX || val == LONG_MIN))
- return -EINVAL;
-
- if (errno != 0 && val == 0)
- return -EINVAL;
-
- if (end == str)
- return -EINVAL;
-
- if (*end != '\0')
- return -EINVAL;
-
- if (val < 1 || val > UINT16_MAX)
- return -EINVAL;
-
- *result = val;
- return 0;
-}
-
-static int strtoull_strict(const char *str, uint64_t *result)
-{
- char *end;
- unsigned long long val;
-
- errno = 0;
- val = strtoull(str, &end, 16);
-
- if (errno == ERANGE && (val == ULLONG_MAX || val == 0))
- return -EINVAL;
-
- if (errno != 0 && val == 0)
- return -EINVAL;
-
- if (end == str)
- return -EINVAL;
-
- if (*end != '\0')
- return -EINVAL;
-
- if (val > UINT64_MAX)
- return -EINVAL;
-
- *result = val;
- return 0;
-}
-
static int
keymap_parse(FILE *fp, char **line, size_t *buf_size, struct keymap *keymap,
uint16_t *rows_return, uint16_t *cols_return,