diff --git a/commit.c b/commit.c
index 5b9234e12e8d1ef46d0d53b15cea850dfbde14c2..a92958cfacbfa88eee4cc52fef0f85308ddfc372 100644 (file)
--- a/commit.c
+++ b/commit.c
encoding = get_header(commit, "encoding");
use_encoding = encoding ? encoding : utf8;
if (!strcmp(use_encoding, output_encoding))
- out = strdup(commit->buffer);
+ out = xstrdup(commit->buffer);
else
out = reencode_string(commit->buffer,
output_encoding, use_encoding);
if (msg + start == ep)
return;
- table[5].value = xstrndup(msg + start, ep - msg + start);
+ table[5].value = xstrndup(msg + start, ep - (msg + start));
/* parse tz */
for (start = ep - msg + 1; start < len && isspace(msg[start]); start++)