Skip to content

Commit 6ef81e2

Browse files
committed
Merge branch 'master' of https://github.com/cesnet/libyang
2 parents ca16cb3 + 82743d4 commit 6ef81e2

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set(CMAKE_MACOSX_RPATH TRUE)
1111
# set version
1212
set(LIBYANG_MAJOR_VERSION 0)
1313
set(LIBYANG_MINOR_VERSION 12)
14-
set(LIBYANG_MICRO_VERSION 199)
14+
set(LIBYANG_MICRO_VERSION 201)
1515
set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_MICRO_VERSION})
1616
set(LIBYANG_SOVERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION})
1717
configure_file(${PROJECT_SOURCE_DIR}/src/libyang.h.in ${PROJECT_SOURCE_DIR}/src/libyang.h)

src/parser.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,11 +1259,13 @@ make_canonical(struct ly_ctx *ctx, int type, const char **value, void *data1, vo
12591259
c = *((uint8_t *)data2);
12601260
if (num) {
12611261
count = sprintf(buf, "%"PRId64" ", num);
1262-
if ((count - 1) <= c) {
1262+
if ( (num > 0 && (count - 1) <= c)
1263+
|| (count - 2) <= c ) {
12631264
/* we have 0. value, print the value with the leading zeros
12641265
* (one for 0. and also keep the correct with of num according
1265-
* to fraction-digits value) */
1266-
count = sprintf(buf, "0%0*"PRId64" ", c, num);
1266+
* to fraction-digits value)
1267+
* for (num<0) - extra character for '-' sign */
1268+
count = sprintf(buf, "%0*"PRId64" ", (num > 0) ? (c + 1) : (c + 2), num);
12671269
}
12681270
for (i = c, j = 1; i > 0 ; i--) {
12691271
if (j && i > 1 && buf[count - 2] == '0') {

tools/lint/main_ni.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,12 @@ main_ni(int argc, char* argv[])
418418
}
419419
}
420420
if (!outformat_d && options_dflt) {
421-
/* we have options for printing default nodes, but output is schema */
422-
fprintf(stderr, "yanglint warning: default mode is ignored when printing schema.\n");
421+
/* we have options for printing default nodes, but data output not specified */
422+
fprintf(stderr, "yanglint warning: default mode is ignored when not printing data.\n");
423423
}
424-
if (!outformat_d && options_parser) {
424+
if (outformat_s && options_parser) {
425425
/* we have options for printing data tree, but output is schema */
426-
fprintf(stderr, "yanglint warning: parser option is ignored when printing schema.\n");
426+
fprintf(stderr, "yanglint warning: data parser options are ignored when printing schema.\n");
427427
}
428428

429429
/* set callback for printing libyang messages */

0 commit comments

Comments
 (0)