tweaks: adjust some whitespace and rewrap a few lines

And remove two unneeded casts.
master
Benno Schulenberg 2019-06-09 20:02:58 +02:00
parent 1075de1222
commit 967f581860
6 changed files with 12 additions and 16 deletions

View File

@ -35,10 +35,8 @@ void do_deletion(undo_type action)
/* When in the middle of a line, delete the current character. */
if (openfile->current->data[openfile->current_x] != '\0') {
int charlen = char_length(openfile->current->data +
openfile->current_x);
size_t line_len = strlen(openfile->current->data +
openfile->current_x);
int charlen = char_length(openfile->current->data + openfile->current_x);
size_t line_len = strlen(openfile->current->data + openfile->current_x);
#ifndef NANO_TINY
/* If the type of action changed or the cursor moved to a different
* line, create a new undo item, otherwise update the existing item. */

View File

@ -295,8 +295,8 @@ int delete_lockfile(const char *lockfilename)
* creating the lockfile but we should continue to load the file. */
int do_lockfile(const char *filename)
{
char *namecopy = (char *) mallocstrcpy(NULL, filename);
char *secondcopy = (char *) mallocstrcpy(NULL, filename);
char *namecopy = mallocstrcpy(NULL, filename);
char *secondcopy = mallocstrcpy(NULL, filename);
size_t locknamesize = strlen(filename) + strlen(locking_prefix)
+ strlen(locking_suffix) + 3;
char *lockfilename = charalloc(locknamesize);

View File

@ -2494,8 +2494,7 @@ void edit_draw(linestruct *fileptr, const char *converted,
/* If the match is of length zero, skip it. */
if (match.rm_so == match.rm_eo) {
index = step_right(fileptr->data,
index + match.rm_eo);
index = step_right(fileptr->data, index + match.rm_eo);
continue;
}
@ -2517,8 +2516,7 @@ void edit_draw(linestruct *fileptr, const char *converted,
paintlen = actual_x(thetext, wideness(fileptr->data,
match.rm_eo) - from_col - start_col);
mvwaddnstr(edit, row, margin + start_col,
thetext, paintlen);
mvwaddnstr(edit, row, margin + start_col, thetext, paintlen);
}
goto tail_of_loop;
}