Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
lvzhengyang
git2
Commits
381991a1
Unverified
Commit
381991a1
authored
Dec 23, 2020
by
Edward Thomson
Committed by
GitHub
Dec 23, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5749 from lhchavez/gcc-10
Fix the `-DENABLE_WERROR=ON` build for gcc 10.2
parents
f4b473fa
212ae9a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
tests/clar/fs.h
+1
-1
tests/clar/sandbox.h
+7
-4
tests/clar_libgit2.c
+4
-3
No files found.
tests/clar/fs.h
View file @
381991a1
...
...
@@ -396,7 +396,7 @@ static void
fs_copy
(
const
char
*
source
,
const
char
*
_dest
)
{
char
*
dbuf
=
NULL
;
const
char
*
dest
;
const
char
*
dest
=
NULL
;
struct
stat
source_st
,
dest_st
;
cl_must_pass_
(
lstat
(
source
,
&
source_st
),
"Failed to stat copy source"
);
...
...
tests/clar/sandbox.h
View file @
381991a1
...
...
@@ -2,7 +2,7 @@
#include <sys/syslimits.h>
#endif
static
char
_clar_path
[
4096
];
static
char
_clar_path
[
4096
+
1
];
static
int
is_valid_tmp_path
(
const
char
*
path
)
...
...
@@ -39,7 +39,8 @@ find_tmp_path(char *buffer, size_t length)
if
(
length
>=
PATH_MAX
&&
realpath
(
env
,
buffer
)
!=
NULL
)
return
0
;
#endif
strncpy
(
buffer
,
env
,
length
);
strncpy
(
buffer
,
env
,
length
-
1
);
buffer
[
length
-
1
]
=
'\0'
;
return
0
;
}
}
...
...
@@ -50,7 +51,8 @@ find_tmp_path(char *buffer, size_t length)
if
(
length
>=
PATH_MAX
&&
realpath
(
"/tmp"
,
buffer
)
!=
NULL
)
return
0
;
#endif
strncpy
(
buffer
,
"/tmp"
,
length
);
strncpy
(
buffer
,
"/tmp"
,
length
-
1
);
buffer
[
length
-
1
]
=
'\0'
;
return
0
;
}
...
...
@@ -65,7 +67,8 @@ find_tmp_path(char *buffer, size_t length)
/* This system doesn't like us, try to use the current directory */
if
(
is_valid_tmp_path
(
"."
))
{
strncpy
(
buffer
,
"."
,
length
);
strncpy
(
buffer
,
"."
,
length
-
1
);
buffer
[
length
-
1
]
=
'\0'
;
return
0
;
}
...
...
tests/clar_libgit2.c
View file @
381991a1
...
...
@@ -275,7 +275,7 @@ const char* cl_git_fixture_url(const char *fixturename)
const
char
*
cl_git_path_url
(
const
char
*
path
)
{
static
char
url
[
4096
];
static
char
url
[
4096
+
1
];
const
char
*
in_buf
;
git_buf
path_buf
=
GIT_BUF_INIT
;
...
...
@@ -311,9 +311,10 @@ const char* cl_git_path_url(const char *path)
in_buf
++
;
}
cl_assert
(
url_buf
.
size
<
4096
);
cl_assert
(
url_buf
.
size
<
sizeof
(
url
)
-
1
);
strncpy
(
url
,
git_buf_cstr
(
&
url_buf
),
4096
);
strncpy
(
url
,
git_buf_cstr
(
&
url_buf
),
sizeof
(
url
)
-
1
);
url
[
sizeof
(
url
)
-
1
]
=
'\0'
;
git_buf_dispose
(
&
url_buf
);
git_buf_dispose
(
&
path_buf
);
return
url
;
...
...
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