Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DIO 5ch TTL a
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC DIO 5ch TTL a
Commits
9b8d2bab
Commit
9b8d2bab
authored
Nov 18, 2020
by
Miguel Jimenez Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
irq-demo: Check FILE pointer before operating with it
parent
2b7ec587
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
file-log.c
sw/irq-demo/dep/file-log.c
+11
-5
No files found.
sw/irq-demo/dep/file-log.c
View file @
9b8d2bab
...
...
@@ -47,8 +47,10 @@ static void send_to_file_log_device(log_device dev, const char *msg)
if
(
!
check_file_log_priv
(
dev
))
{
priv
=
get_private_info
(
dev
);
fputs
(
msg
,
priv
->
fp
);
fputs
(
"
\n
"
,
priv
->
fp
);
if
(
priv
&&
priv
->
fp
)
{
fputs
(
msg
,
priv
->
fp
);
fputs
(
"
\n
"
,
priv
->
fp
);
}
}
}
...
...
@@ -56,10 +58,14 @@ static void deinit_file_log_device(log_device dev)
{
struct
file_log_private
*
priv
;
if
(
dev
->
private
)
{
if
(
!
check_file_log_priv
(
dev
)
)
{
priv
=
get_private_info
(
dev
);
fclose
(
priv
->
fp
);
free
(
dev
->
private
);
if
(
priv
)
{
if
(
priv
->
fp
)
{
fclose
(
priv
->
fp
);
}
free
(
priv
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment