Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
a29cf52b
Commit
a29cf52b
authored
8 years ago
by
dawehr
Browse files
Options
Downloads
Patches
Plain Diff
Made it so logging won't segfault/write to random memory if not initialized.
parent
bbd1dcf1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
quad/src/quad_app/log_data.c
+4
-2
4 additions, 2 deletions
quad/src/quad_app/log_data.c
with
4 additions
and
2 deletions
quad/src/quad_app/log_data.c
+
4
−
2
View file @
a29cf52b
...
...
@@ -20,7 +20,7 @@
// Current index of the log array
int
arrayIndex
=
0
;
// Size of the array
int
arraySize
=
LOG_STARTING_SIZE
;
int
arraySize
=
0
;
struct
graph_tuple
{
// Tuple for
int
block_id
;
...
...
@@ -38,7 +38,7 @@ struct graph_tuple log_params[MAX_LOG_NUM];
size_t
n_outputs
;
size_t
n_params
;
float
*
logArray
;
float
*
logArray
=
NULL
;
int
row_size
;
static
char
units_output_str
[
512
]
=
{};
...
...
@@ -112,6 +112,8 @@ void initialize_logging(log_t* log_struct, parameter_t* ps) {
logArray
=
malloc
(
needed_memory
);
if
(
!
logArray
)
{
// malloc failed
arraySize
=
0
;
}
else
{
arraySize
=
LOG_STARTING_SIZE
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment