diff --git a/PBGitCommit.m b/PBGitCommit.m index 36d3b09..1db6cd5 100644 --- a/PBGitCommit.m +++ b/PBGitCommit.m @@ -26,8 +26,8 @@ NSString * const kGitXCommitType = @"commit"; NSMutableArray *p = [NSMutableArray arrayWithCapacity:nParents]; for (i = 0; i < nParents; ++i) { - char buff[2000]; - char * s = git_oid_to_string(buff, 2000, parentShas + i); + char buff[GIT_OID_HEXSZ+1]; + char * s = git_oid_to_string(buff, GIT_OID_HEXSZ+1, parentShas + i); [p addObject:[NSString stringWithUTF8String:s]]; } return p; @@ -127,8 +127,8 @@ NSString * const kGitXCommitType = @"commit"; - (NSString *)realSha { if (!realSHA) { - char buff[2000]; - char * hex = git_oid_to_string(buff, 2000, &sha); + char buff[GIT_OID_HEXSZ+1]; + char * hex = git_oid_to_string(buff, GIT_OID_HEXSZ+1, &sha); realSHA = [NSString stringWithUTF8String:hex]; } diff --git a/html/views/history/history.js b/html/views/history/history.js index 0c02b86..65c188a 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -7,8 +7,8 @@ var Commit = function(obj) { this.refs = obj.refs(); this.author_name = obj.author; - this.sha = obj.realSha(); - this.parents = obj.parents; + this.sha = obj.realSha(); + this.parents = obj.parents; this.subject = obj.subject; this.notificationID = null;