lyb parser BUGFIX use platform-independent print chars
Fixes #580
diff --git a/src/parser_lyb.c b/src/parser_lyb.c
index e88cfe3..0c097de 100644
--- a/src/parser_lyb.c
+++ b/src/parser_lyb.c
@@ -16,6 +16,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <inttypes.h>
#include "libyang.h"
#include "common.h"
@@ -566,11 +567,11 @@
*value_str = lydict_insert(ctx, num_str, 0);
break;
case LY_TYPE_INT64:
- sprintf(num_str, "%ld", value->int64);
+ sprintf(num_str, "%"PRId64, value->int64);
*value_str = lydict_insert(ctx, num_str, 0);
break;
case LY_TYPE_UINT64:
- sprintf(num_str, "%lu", value->uint64);
+ sprintf(num_str, "%"PRIu64, value->uint64);
*value_str = lydict_insert(ctx, num_str, 0);
break;
case LY_TYPE_DEC64:
@@ -582,7 +583,7 @@
--dig;
}
- sprintf(num_str, "%ld.%.*ld", value->dec64 / (int64_t)type->info.dec64.div, dig, frac);
+ sprintf(num_str, "%"PRId64".%.*"PRId64, value->dec64 / (int64_t)type->info.dec64.div, dig, frac);
*value_str = lydict_insert(ctx, num_str, 0);
break;
default: