Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
97a1e53f
Unverified
Commit
97a1e53f
authored
5 years ago
by
Richard Cordovano
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1892 from anastmag/work
Check localtime return value
parents
07917947
cc3afabc
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
tsk/fs/fs_name.c
+9
-9
9 additions, 9 deletions
tsk/fs/fs_name.c
with
9 additions
and
9 deletions
tsk/fs/fs_name.c
+
9
−
9
View file @
97a1e53f
...
...
@@ -297,13 +297,13 @@ tsk_fs_meta_make_ls(const TSK_FS_META * a_fs_meta, char *a_buf,
char
*
tsk_fs_time_to_str
(
time_t
time
,
char
buf
[
128
])
{
struct
tm
*
tmTime
;
buf
[
0
]
=
'\0'
;
if
(
time
<=
0
)
{
if
(
time
<=
0
||
(
tmTime
=
localtime
(
&
time
))
==
NULL
)
{
strncpy
(
buf
,
"0000-00-00 00:00:00 (UTC)"
,
128
);
}
else
{
struct
tm
*
tmTime
=
localtime
(
&
time
);
snprintf
(
buf
,
128
,
"%.4d-%.2d-%.2d %.2d:%.2d:%.2d (%s)"
,
(
int
)
tmTime
->
tm_year
+
1900
,
(
int
)
tmTime
->
tm_mon
+
1
,
(
int
)
tmTime
->
tm_mday
,
...
...
@@ -326,13 +326,13 @@ char *
tsk_fs_time_to_str_subsecs
(
time_t
time
,
unsigned
int
subsecs
,
char
buf
[
128
])
{
struct
tm
*
tmTime
;
buf
[
0
]
=
'\0'
;
if
(
time
<=
0
)
{
if
(
time
<=
0
||
(
tmTime
=
localtime
(
&
time
))
==
NULL
)
{
strncpy
(
buf
,
"0000-00-00 00:00:00 (UTC)"
,
32
);
}
else
{
struct
tm
*
tmTime
=
localtime
(
&
time
);
snprintf
(
buf
,
64
,
"%.4d-%.2d-%.2d %.2d:%.2d:%.2d.%.9d (%s)"
,
(
int
)
tmTime
->
tm_year
+
1900
,
(
int
)
tmTime
->
tm_mon
+
1
,
(
int
)
tmTime
->
tm_mday
,
...
...
@@ -368,12 +368,12 @@ tsk_fs_print_time(FILE * hFile, time_t time)
static
void
tsk_fs_print_day
(
FILE
*
hFile
,
time_t
time
)
{
if
(
time
<=
0
)
{
struct
tm
*
tmTime
;
if
(
time
<=
0
||
(
tmTime
=
localtime
(
&
time
))
==
NULL
)
{
tsk_fprintf
(
hFile
,
"0000-00-00 00:00:00 (UTC)"
);
}
else
{
struct
tm
*
tmTime
=
localtime
(
&
time
);
tsk_fprintf
(
hFile
,
"%.4d-%.2d-%.2d 00:00:00 (%s)"
,
(
int
)
tmTime
->
tm_year
+
1900
,
(
int
)
tmTime
->
tm_mon
+
1
,
(
int
)
tmTime
->
tm_mday
,
...
...
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