Skip to content

Commit 0c544a2

Browse files
committed
Merge branch 'sb/misc-fixes'
Assorted code cleanups and a minor fix. * sb/misc-fixes: diff.c: Do not initialize a variable, which gets reassigned anyway. commit: Fix a memory leak in determine_author_info daemon.c:handle: Remove unneeded check for null pointer.
2 parents 1762224 + d3c9cf3 commit 0c544a2

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

builtin/commit.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ static void determine_author_info(struct strbuf *author_ident)
534534
(lb - strlen(" ") -
535535
(a + strlen("\nauthor "))));
536536
email = xmemdupz(lb + strlen("<"), rb - (lb + strlen("<")));
537-
date = xmemdupz(rb + strlen("> "), eol - (rb + strlen("> ")));
538537
len = eol - (rb + strlen("> "));
539538
date = xmalloc(len + 2);
540539
*date = '@';

daemon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
760760
snprintf(portbuf, sizeof(portbuf), "REMOTE_PORT=%d",
761761
ntohs(sin_addr->sin_port));
762762
#ifndef NO_IPV6
763-
} else if (addr && addr->sa_family == AF_INET6) {
763+
} else if (addr->sa_family == AF_INET6) {
764764
struct sockaddr_in6 *sin6_addr = (void *) addr;
765765

766766
char *buf = addrbuf + 12;

diff.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,9 +1683,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
16831683
del = deleted;
16841684

16851685
if (graph_width <= max_change) {
1686-
int total = add + del;
1687-
1688-
total = scale_linear(add + del, graph_width, max_change);
1686+
int total = scale_linear(add + del, graph_width, max_change);
16891687
if (total < 2 && add && del)
16901688
/* width >= 2 due to the sanity check */
16911689
total = 2;

0 commit comments

Comments
 (0)