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
41051e3f
Commit
41051e3f
authored
Feb 20, 2013
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
signature: Shut up MSVC, you silly goose
parent
c51880ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
src/signature.c
+3
-6
src/util.h
+15
-0
No files found.
src/signature.c
View file @
41051e3f
...
...
@@ -133,17 +133,14 @@ int git_signature__parse(git_signature *sig, const char **buffer_out,
if
(
header
)
{
const
size_t
header_len
=
strlen
(
header
);
if
(
buffer
_end
-
buffer
<
header_len
||
memcmp
(
buffer
,
header
,
header_len
)
!=
0
)
if
(
buffer
+
header_len
>=
buffer_end
||
memcmp
(
buffer
,
header
,
header_len
)
!=
0
)
return
signature_error
(
"expected prefix doesn't match actual"
);
buffer
+=
header_len
;
}
if
(
buffer
>=
buffer_end
)
return
signature_error
(
"signature too short"
);
email_start
=
memrchr
(
buffer
,
'<'
,
buffer_end
-
buffer
);
email_end
=
memrchr
(
buffer
,
'>'
,
buffer_end
-
buffer
);
email_start
=
git__memrchr
(
buffer
,
'<'
,
buffer_end
-
buffer
);
email_end
=
git__memrchr
(
buffer
,
'>'
,
buffer_end
-
buffer
);
if
(
!
email_start
||
!
email_end
||
email_end
<=
email_start
)
return
signature_error
(
"malformed e-mail"
);
...
...
src/util.h
View file @
41051e3f
...
...
@@ -127,6 +127,21 @@ GIT_INLINE(const char *) git__next_line(const char *s)
return
s
;
}
GIT_INLINE
(
const
void
*
)
git__memrchr
(
const
void
*
s
,
int
c
,
size_t
n
)
{
const
unsigned
char
*
cp
;
if
(
n
!=
0
)
{
cp
=
(
unsigned
char
*
)
s
+
n
;
do
{
if
(
*
(
--
cp
)
==
(
unsigned
char
)
c
)
return
cp
;
}
while
(
--
n
!=
0
);
}
return
NULL
;
}
typedef
int
(
*
git__tsort_cmp
)(
const
void
*
a
,
const
void
*
b
);
extern
void
git__tsort
(
void
**
dst
,
size_t
size
,
git__tsort_cmp
cmp
);
...
...
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