Skip to content

Commit da9ba82

Browse files
committed
Fix linking error and switch to snprintf for safer buffer filling
1 parent 4e67f8c commit da9ba82

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@ __pycache__/
3939

4040
# macOS
4141
.DS_Store
42+
test/dags/cached-execution.toml
43+
test/dags/dagify.py
44+
test/dags/hierarchical-nodes.toml
45+
test/dags/repeater-reduced.gv
46+
test/dags/repeater-reduced.pdf
47+
test/dags/repeater-reduced.png
48+
test/dags/repeater.gv
49+
test/dags/repeater.pdf
50+
test/dags/repeater.png
51+
test/dags/repeater.toml

test/form/data_products/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ add_library(
33
${FORM_DATA_PROD_LIB_NAME} SHARED track_start.cpp
44
) # REFLEX_GENERATE_DICTIONARY doesn't work trivially without making a shared
55
# library
6-
target_link_libraries(${FORM_DATA_PROD_LIB_NAME})
6+
target_link_libraries(${FORM_DATA_PROD_LIB_NAME} ROOT::RIO)
77

88
if(FORM_USE_ROOT_STORAGE)
99
find_package(ROOT REQUIRED COMPONENTS Core RIO)

test/form/reader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int main(int /* argc*/, char** /* argv[]*/)
4343
// Processing per sub-event
4444
std::vector<float> const* track_start_x = nullptr;
4545
char seg_id_text[64];
46-
sprintf(seg_id_text, seg_id, nevent, nseg);
46+
snprintf(seg_id_text, 64, seg_id, nevent, nseg);
4747
std::string const creator = "Toy_Tracker";
4848
mock_phlex::product_base pb = {
4949
"trackStart", seg_id_text, track_start_x, std::type_index{typeid(std::vector<float>)}};
@@ -87,7 +87,7 @@ int main(int /* argc*/, char** /* argv[]*/)
8787
std::cout << "PHLEX: Read Event segments done " << nevent << std::endl;
8888

8989
char evt_id_text[64];
90-
sprintf(evt_id_text, evt_id, nevent);
90+
snprintf(evt_id_text, 64, evt_id, nevent);
9191
std::string const creator = "Toy_Tracker_Event";
9292
mock_phlex::product_base pb = {
9393
"trackStartX", evt_id_text, track_x, std::type_index{typeid(std::vector<float>)}};

test/form/writer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ int main(int /*argc*/, char** /* argv[]*/)
7272
// done, phlex call write(mock_phlex::product_base)
7373
// sub-event writing called by phlex
7474
char seg_id_text[64];
75-
sprintf(seg_id_text, seg_id, nevent, nseg);
75+
snprintf(seg_id_text, 64, seg_id, nevent, nseg);
7676
std::vector<mock_phlex::product_base> batch;
7777
std::string const creator = "Toy_Tracker";
7878
mock_phlex::product_base pb = {
@@ -122,7 +122,7 @@ int main(int /*argc*/, char** /* argv[]*/)
122122

123123
// event writing, current framework, will also write references
124124
char evt_id_text[64];
125-
sprintf(evt_id_text, evt_id, nevent);
125+
snprintf(evt_id_text, 64, evt_id, nevent);
126126
std::string const creator = "Toy_Tracker_Event";
127127
mock_phlex::product_base pb = {
128128
"trackStartX", evt_id_text, &track_x, std::type_index{typeid(std::vector<float>)}};

0 commit comments

Comments
 (0)