ls: prefer xpalloc to xnrealloc
commit4cb726e4a6e3b839ceb3ed84cc66adf401f7ebad
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 Nov 2024 06:30:09 +0000 (7 22:30 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 9 Nov 2024 07:41:18 +0000 (8 23:41 -0800)
treec2908e18ac3dcf35ecb59b45cdf2058ea9c66390
parent612e64e132e3ef57f25176b07dc6d2be89398c0b
ls: prefer xpalloc to xnrealloc

* src/ls.c (cwd_n_alloc, cwd_n_used, clear_files)
(extract_dirs_from_files, initialize_ordering_vector)
(update_current_files_info, sort_files, print_current_files)
(print_many_per_line, print_horizontal, print_with_separator)
(init_column_info, calculate_columns):
Prefer idx_t to size_t for sizes related to xpalloc.
(main): Let the compiler fold constants.
(gobble_file, init_column_info): Use xpalloc, not xnrealloc.
(print_many_per_line): Fix very-unlikely integer overflow.
src/ls.c