Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
1c4de827
Commit
1c4de827
authored
Feb 13, 2008
by
ivoire
Browse files
Check asprintf return value.
parent
9bee48ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/misc/update.c
View file @
1c4de827
...
...
@@ -1178,15 +1178,17 @@ int update_CompareReleaseToCurrent( update_t *p_update )
static
char
*
size_str
(
long
int
l_size
)
{
char
*
psz_tmp
=
NULL
;
int
i_retval
=
0
;
if
(
l_size
>>
30
)
asprintf
(
&
psz_tmp
,
"%.1f GB"
,
(
float
)
l_size
/
(
1
<<
30
)
);
i_retval
=
asprintf
(
&
psz_tmp
,
"%.1f GB"
,
(
float
)
l_size
/
(
1
<<
30
)
);
else
if
(
l_size
>>
20
)
asprintf
(
&
psz_tmp
,
"%.1f MB"
,
(
float
)
l_size
/
(
1
<<
20
)
);
i_retval
=
asprintf
(
&
psz_tmp
,
"%.1f MB"
,
(
float
)
l_size
/
(
1
<<
20
)
);
else
if
(
l_size
>>
10
)
asprintf
(
&
psz_tmp
,
"%.1f kB"
,
(
float
)
l_size
/
(
1
<<
10
)
);
i_retval
=
asprintf
(
&
psz_tmp
,
"%.1f kB"
,
(
float
)
l_size
/
(
1
<<
10
)
);
else
asprintf
(
&
psz_tmp
,
"%ld B"
,
l_size
);
return
psz_tmp
;
i_retval
=
asprintf
(
&
psz_tmp
,
"%ld B"
,
l_size
);
return
i_retval
==
-
1
?
NULL
:
psz_tmp
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment