Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-12-01 00:52:42 +0400
committerBen Straub <bs@github.com>2012-12-01 01:12:16 +0400
commit4ec197f3049d203739066e0c2d2c5c39f78fd808 (patch)
tree94637d0def9f59554fd59efdaaec283e34dd9c26 /src/signature.c
parent10711769000d009189f83e468f25b719fa303086 (diff)
Deploy GIT_SIGNATURE_INIT
Diffstat (limited to 'src/signature.c')
-rw-r--r--src/signature.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/signature.c b/src/signature.c
index 0159488a4..008b13120 100644
--- a/src/signature.c
+++ b/src/signature.c
@@ -90,6 +90,7 @@ int git_signature_new(git_signature **sig_out, const char *name, const char *ema
p = git__calloc(1, sizeof(git_signature));
GITERR_CHECK_ALLOC(p);
+ p->version = GIT_SIGNATURE_VERSION;
if (process_trimming(name, &p->name, name + strlen(name), 1) < 0 ||
process_trimming(email, &p->email, email + strlen(email), 1) < 0)
@@ -263,8 +264,9 @@ int git_signature__parse(git_signature *sig, const char **buffer_out,
const char *buffer = *buffer_out;
const char *line_end, *name_end, *email_end, *tz_start, *time_start;
int error = 0;
+ git_signature initsig = GIT_SIGNATURE_INIT;
- memset(sig, 0x0, sizeof(git_signature));
+ memmove(sig, &initsig, sizeof(git_signature));
if ((line_end = memchr(buffer, ender, buffer_end - buffer)) == NULL)
return signature_error("no newline given");