mirror of git://git.sv.gnu.org/nano.git
tweaks: unwrap three lines that don't need to be wrapped
(These lines were noticed while checking that all calls of nrealloc() use a size bigger than zero.)
This commit is contained in:
parent
fe0b928b39
commit
b812ad2926
|
@ -572,8 +572,7 @@ char *browse(char *path)
|
|||
|
||||
/* If the given path is relative, join it with the current path. */
|
||||
if (*path != '/') {
|
||||
path = nrealloc(path, strlen(present_path) +
|
||||
strlen(answer) + 1);
|
||||
path = nrealloc(path, strlen(present_path) + strlen(answer) + 1);
|
||||
sprintf(path, "%s%s", present_path, answer);
|
||||
}
|
||||
|
||||
|
|
|
@ -2547,9 +2547,7 @@ char **filename_completion(const char *morsel, size_t *num_matches)
|
|||
if (strncmp(entry->d_name, filename, filenamelen) == 0 &&
|
||||
strcmp(entry->d_name, ".") != 0 &&
|
||||
strcmp(entry->d_name, "..") != 0) {
|
||||
fullname = nrealloc(fullname, strlen(dirname) +
|
||||
strlen(entry->d_name) + 1);
|
||||
|
||||
fullname = nrealloc(fullname, strlen(dirname) + strlen(entry->d_name) + 1);
|
||||
sprintf(fullname, "%s%s", dirname, entry->d_name);
|
||||
|
||||
#ifdef ENABLE_OPERATINGDIR
|
||||
|
|
|
@ -1588,8 +1588,7 @@ void concat_paragraph(linestruct *line, size_t count)
|
|||
line->data[line_len] = '\0';
|
||||
}
|
||||
|
||||
line->data = nrealloc(line->data,
|
||||
line_len + next_line_len - next_lead_len + 1);
|
||||
line->data = nrealloc(line->data, line_len + next_line_len - next_lead_len + 1);
|
||||
strcat(line->data, next_line->data + next_lead_len);
|
||||
#ifndef NANO_TINY
|
||||
line->has_anchor |= next_line->has_anchor;
|
||||
|
|
Loading…
Reference in New Issue