aboutsummaryrefslogtreecommitdiffstats
path: root/src/getstring.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove parentheses from return statementsLukas Fleischer2011-11-021-2/+2
| | | | | | | | | | | | | | No reason to use "return (x);" here. Refer to the GNU coding guidelines for details. Created using following semantic patch: @@ expression expr; @@ - return (expr); + return expr; Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Do not cast unused return values to voidLukas Fleischer2011-11-021-2/+2
| | | | | | | | | | | | | | | | | | | | A small style fix that removes all remaining "(void)" casts. Using these isn't encouraged in GNU coding guidelines and doesn't serve a certain purpose, except for satisfying a few static code analysis tools. We already nuked some of these in previous patches, but this semantic patch should fix what's left: @@ identifier func; @@ - (void)func ( + func ( ...); Long lines were re-formatted manually. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Avoid use of printf()/fprintf()Lukas Fleischer2011-11-021-1/+1
| | | | | | | | | | | | | | | | Use one of the following functions where appropriate: * puts() (whenever we print hard coded strings to stdout) * fputs() (whenever we print hard coded strings to a stream) * putchar() (whenever we print a single character to stdout) * fputc() (whenever we print a single character to a stream) * strncpy() (whenever we copy hard coded strings to a buffer) This removes the overhead introduced by the format string parser and reduces the number of false positive C-format strings spotted by xgettext(1)'s heuristics. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Avoid segfault in getstr_fixscr()Lukas Fleischer2011-07-021-2/+2
| | | | | | | | Avoid a segfault that may occur if getstr_fixscr() changes the scroll offset to something outside the input boundaries (e.g. if a word that is only partly visible is killed via backward-kill-word). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use constant for maximum UTF-8 character sizeLukas Fleischer2011-07-021-2/+3
| | | | | | | Introduce a UTF8_MAXLEN constant instead of using the literal value "6" at various places. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Refactor getstring codeLukas Fleischer2011-07-021-53/+65
| | | | | | | | | | * Rename static showstring() function to getstr_print(), rename ins_char() to getstr_ins_char() and del_char() to getstr_del_char(). * Refactor out getstring data structure initialization and window scrolling routines. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Make getstring() UTF-8 compatibleLukas Fleischer2011-06-291-54/+120
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Split line editing functions into separate fileLukas Fleischer2011-06-291-0/+220
Move getstring() related stuff into a separate file as a first step on our way to UTF-8 support for line editing helpers. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>