parser BUGFIX always convert to long long
diff --git a/src/parser_stmt.c b/src/parser_stmt.c
index 01a598e..2875b75 100644
--- a/src/parser_stmt.c
+++ b/src/parser_stmt.c
@@ -542,8 +542,8 @@
{
size_t arg_len;
char *ptr = NULL;
- long int num = 0;
- unsigned long int unum = 0;
+ long long int num = 0;
+ unsigned long long int unum = 0;
if (*flags & LYS_SET_VALUE) {
LOGVAL_PARSER(ctx, LY_VCODE_DUPSTMT, ly_stmt2str(stmt->kw));
@@ -562,13 +562,13 @@
errno = 0;
if (stmt->kw == LY_STMT_VALUE) {
- num = strtol(stmt->arg, &ptr, LY_BASE_DEC);
+ num = strtoll(stmt->arg, &ptr, LY_BASE_DEC);
if ((num < INT64_C(-2147483648)) || (num > INT64_C(2147483647))) {
LOGVAL_PARSER(ctx, LY_VCODE_INVAL, arg_len, stmt->arg, ly_stmt2str(stmt->kw));
goto error;
}
} else {
- unum = strtoul(stmt->arg, &ptr, LY_BASE_DEC);
+ unum = strtoull(stmt->arg, &ptr, LY_BASE_DEC);
if (unum > UINT64_C(4294967295)) {
LOGVAL_PARSER(ctx, LY_VCODE_INVAL, arg_len, stmt->arg, ly_stmt2str(stmt->kw));
goto error;
@@ -681,7 +681,7 @@
{
char *ptr;
size_t arg_len;
- unsigned long int num;
+ unsigned long long int num;
if (*fracdig) {
LOGVAL_PARSER(ctx, LY_VCODE_DUPSTMT, "fraction-digits");
@@ -696,7 +696,7 @@
}
errno = 0;
- num = strtoul(stmt->arg, &ptr, LY_BASE_DEC);
+ num = strtoull(stmt->arg, &ptr, LY_BASE_DEC);
/* we have not parsed the whole argument */
if ((size_t)(ptr - stmt->arg) != arg_len) {
LOGVAL_PARSER(ctx, LY_VCODE_INVAL, arg_len, stmt->arg, "fraction-digits");
@@ -1069,7 +1069,7 @@
{
size_t arg_len;
char *ptr;
- unsigned long int num;
+ unsigned long long int num;
if (*flags & LYS_SET_MAX) {
LOGVAL_PARSER(ctx, LY_VCODE_DUPSTMT, "max-elements");
@@ -1088,7 +1088,7 @@
if ((arg_len != ly_strlen_const("unbounded")) || strncmp(stmt->arg, "unbounded", arg_len)) {
errno = 0;
- num = strtoul(stmt->arg, &ptr, LY_BASE_DEC);
+ num = strtoull(stmt->arg, &ptr, LY_BASE_DEC);
/* we have not parsed the whole argument */
if ((size_t)(ptr - stmt->arg) != arg_len) {
LOGVAL_PARSER(ctx, LY_VCODE_INVAL, arg_len, stmt->arg, "max-elements");
@@ -1136,7 +1136,7 @@
{
size_t arg_len;
char *ptr;
- unsigned long int num;
+ unsigned long long int num;
if (*flags & LYS_SET_MIN) {
LOGVAL_PARSER(ctx, LY_VCODE_DUPSTMT, "min-elements");
@@ -1154,7 +1154,7 @@
}
errno = 0;
- num = strtoul(stmt->arg, &ptr, LY_BASE_DEC);
+ num = strtoull(stmt->arg, &ptr, LY_BASE_DEC);
/* we have not parsed the whole argument */
if ((size_t)(ptr - stmt->arg) != arg_len) {
LOGVAL_PARSER(ctx, LY_VCODE_INVAL, arg_len, stmt->arg, "min-elements");