about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-10-27 13:50:18 +0200
committerLars Hjemli <hjemli@gmail.com>2007-10-27 13:55:12 +0200
commitc61360fea0357672d2ab84a2c5a41ae1569f5d8a (patch)
treec0d55917537b1cbc8237ee63e3a1252abbdded40
parentSkip unknown header fields when parsing tags and commits (diff)
downloadcgit-pink-c61360fea0357672d2ab84a2c5a41ae1569f5d8a.tar.gz
cgit-pink-c61360fea0357672d2ab84a2c5a41ae1569f5d8a.zip
cgit_parse_commit(): Add missing call to xstrdup()
It's rather silly to point into random memory-locations. Also, remove a
call to strdup() used on a literal char *.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to '')
-rw-r--r--parsing.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parsing.c b/parsing.c
index ddbafd5..30e7648 100644
--- a/parsing.c
+++ b/parsing.c
@@ -242,14 +242,14 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
 	t = strchr(p, '\n');
 	if (t) {
 		if (*t == '\0')
-			ret->subject = strdup("** empty **");
+			ret->subject = "** empty **";
 		else
 			ret->subject = substr(p, t);
 		p = t + 1;
 
 		while (*p == '\n')
 			p = strchr(p, '\n') + 1;
-		ret->msg = p;
+		ret->msg = xstrdup(p);
 	} else
 		ret->subject = substr(p, p+strlen(p));
 
2018-02-06Require 4 bit counts on gfxx command lineJune McEnroe 2018-02-06Add gfxx controls for custom bitsJune McEnroe 2018-02-06Add gfxx palette loading and dumpingJune McEnroe 2018-02-06Add tags targetJune McEnroe This seems a bit out of character for me, but this is basically free: ctags(1) is part of FreeBSD and Darwin, and vim automatically uses tags. Also the format of tags files is cute. 2018-02-06Replace gfxx SCALE macro with interp functionJune McEnroe Short-circuits for b = 8. 2018-02-05Rename gfxx space indexed and add palette samplingJune McEnroe 2018-02-05Take scale into account for when to stop drawing in gfxxJune McEnroe 2018-02-05Always skip most significant bits in gfxxJune McEnroe This works for CARDS.DLL but might not for other things. We'll see. 2018-02-05Set title in gfcocoaJune McEnroe 2018-02-05Double-buffer gfb frontendJune McEnroe Still not vsync (seems like a newer DRM-fbdev implementation handles FBIO_WAITFORVSYNC but my kernel doesn't), but avoids flicker from clearing to black for each frame. 2018-02-05Rewrite gfxx bit handlingJune McEnroe Specifies how many bits for each of "alpha" (ignored), red, green, blue. Separates byte-order and bit-order. Much more flexible, but now won't render CARDS.DLL graphics properly due to the skip bit being not where it expects. Also mmaps the file instead of reading it all in. And the default palette and sampling got removed again for now, since it's too awkward to use. 2018-02-05Add flip option to gfxxJune McEnroe This handles upside-down graphics much better than reverse did. 2018-02-05Remove gfxx reverse optionJune McEnroe 2018-02-04Fix gfxx draw stop conditionJune McEnroe Would not draw the last partially visible column when mirrored. 2018-02-04Reuse CGColorSpace and CGDataProvider in gfcocoaJune McEnroe 2018-02-04Mark mac target phonyJune McEnroe 2018-02-04Set up Makefile for gfxx-cocoa or gfxx-fbJune McEnroe 2018-02-04Avoid doing excessive work in gfxxJune McEnroe By stopping when the next column would be off the edge of the buffer. 2018-02-04Handle window resizing in gfcocoaJune McEnroe 2018-02-04Set cinoptionsJune McEnroe 2018-02-04Tweak colorscheme moreJune McEnroe 2018-02-04Color MatchParen DarkYellowJune McEnroe White is not obvious enough. 2018-02-04Add palette sampling to gfxxJune McEnroe 2018-02-04Add 4-bit RGB to gfxxJune McEnroe Replace default palette with alternating black and white. 2018-02-04Add Quit menu item to gfcocoaJune McEnroe 2018-02-04Switch back to sane Objective-C styleJune McEnroe 2018-02-04Quit gfcocoa when window closesJune McEnroe 2018-02-03Apparently this is how people write Objective-CJune McEnroe