]> git.tuebingen.mpg.de Git - paraslash.git/commit
gui: Avoid unnecessary strdup's and replace newlines by spaces in curses output.
authorAndre Noll <maan@systemlinux.org>
Sun, 5 Jul 2009 08:53:06 +0000 (10:53 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 5 Jul 2009 08:53:06 +0000 (10:53 +0200)
commit01117585025befdce6edd8c67b3fad295d171623
tree3acff4f1e8c04a4a2889ac7f4d63474d07eafade
parentbced94f9f81fdf355b61738e968aa8b61bfc36e7
gui: Avoid unnecessary strdup's and replace newlines by spaces in curses output.

align_str() made a copy of the given buffer because one of its callers, print_in_bar(),
passes a string literal and align_str() needs to truncate large strings.However, all other
callers pass a writable string anyway, so do the strdup() in print_in_bar(). This avoids the
unnecessary copies for each status item.

The areas for the status items was designed to hold only a part of a single line, so status
item text should not contain newlines. The patch replaces newlines by spaces.

Also get rid of a stale comment.
gui.c