Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/utests/schema_comparison/test_schema_comparison.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ schema_comparison(struct sc_state *st, const char *module_name)
fseek(st->f, 0, SEEK_SET);
st->exp = malloc(size + 1);
assert_non_null(st->exp);
assert_int_equal(size, fread(st->exp, 1, size, st->f));
size = fread(st->exp, 1, size, st->f);
st->exp[size] = '\0';

/* compare the output */
Expand Down
6 changes: 3 additions & 3 deletions tests/yangupdate/complex_update/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ test_update_01_01_to_01_20(void **state)
rewind(st->f);
st->str1 = malloc(size + 1);
assert_non_null(st->str1);
fread(st->str1, 1, size, st->f);
size = fread(st->str1, 1, size, st->f);
st->str1[size] = '\0';
assert_string_equal(st->str2, st->str1);
}
Expand Down Expand Up @@ -140,7 +140,7 @@ test_update_01_10_to_01_15(void **state)
rewind(st->f);
st->str1 = malloc(size + 1);
assert_non_null(st->str1);
fread(st->str1, 1, size, st->f);
size = fread(st->str1, 1, size, st->f);
st->str1[size] = '\0';
assert_string_equal(st->str2, st->str1);
}
Expand Down Expand Up @@ -177,7 +177,7 @@ test_update_01_15_to_01_20(void **state)
rewind(st->f);
st->str1 = malloc(size + 1);
assert_non_null(st->str1);
fread(st->str1, 1, size, st->f);
size = fread(st->str1, 1, size, st->f);
st->str1[size] = '\0';
assert_string_equal(st->str2, st->str1);
}
Expand Down
1 change: 1 addition & 0 deletions tools/update/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ endif()

# yang update library
add_library(${LIB_NAME} STATIC ${lib_src})
target_compile_definitions(${LIB_NAME} PUBLIC LIBYANG_BUILD)
target_include_directories(${LIB_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_BINARY_DIR})
get_target_property(yang_linked_libraries yang LINK_LIBRARIES)
target_link_libraries(${LIB_NAME} $<TARGET_OBJECTS:yangobj> ${yang_linked_libraries})
Expand Down
2 changes: 1 addition & 1 deletion tools/update/yang_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ yu_module_imp_clb(const char *mod_name, const char *mod_rev, const char *submod_
rc = LY_EMEM;
goto cleanup;
}
fread(data, 1, size, f);
size = fread(data, 1, size, f);
data[size] = '\0';

*format = fmt;
Expand Down
Loading