Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
35f981d5
Commit
35f981d5
authored
Jan 10, 2014
by
antma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace sprintf call with snprintf for downloaded part name
parent
c1557971
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
queries.c
queries.c
+8
-3
No files found.
queries.c
View file @
35f981d5
...
@@ -1822,11 +1822,16 @@ struct query_methods download_methods = {
...
@@ -1822,11 +1822,16 @@ struct query_methods download_methods = {
void
load_next_part
(
struct
download
*
D
)
{
void
load_next_part
(
struct
download
*
D
)
{
if
(
!
D
->
offset
)
{
if
(
!
D
->
offset
)
{
static
char
buf
[
1000
];
static
char
buf
[
PATH_MAX
];
int
l
;
if
(
!
D
->
id
)
{
if
(
!
D
->
id
)
{
sprintf
(
buf
,
"%s/download_%lld_%d"
,
get_downloads_directory
(),
D
->
volume
,
D
->
local_id
);
l
=
snprintf
(
buf
,
sizeof
(
buf
)
,
"%s/download_%lld_%d"
,
get_downloads_directory
(),
D
->
volume
,
D
->
local_id
);
}
else
{
}
else
{
sprintf
(
buf
,
"%s/download_%lld"
,
get_downloads_directory
(),
D
->
id
);
l
=
snprintf
(
buf
,
sizeof
(
buf
),
"%s/download_%lld"
,
get_downloads_directory
(),
D
->
id
);
}
if
(
l
>=
(
int
)
sizeof
(
buf
))
{
logprintf
(
"Download filename is too long"
);
exit
(
1
);
}
}
D
->
name
=
tstrdup
(
buf
);
D
->
name
=
tstrdup
(
buf
);
struct
stat
st
;
struct
stat
st
;
...
...
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