aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2026-02-06 11:19:11 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2026-02-06 11:19:11 +0100
commit9b2a50efe227048e3d5029148619d5cc5ad089be (patch)
tree37d757a8cefd52810093e7454a324932123ee9e3 /miscutils
parent89f37ebe8c7f2ebdd7a623cccf1860dc4ab7b0b7 (diff)
downloadbusybox-w32-9b2a50efe227048e3d5029148619d5cc5ad089be.tar.gz
busybox-w32-9b2a50efe227048e3d5029148619d5cc5ad089be.tar.bz2
busybox-w32-9b2a50efe227048e3d5029148619d5cc5ad089be.zip
*: use xasprintf_inplace() in more places
function old new delta .rodata 107009 107018 +9 parse_stream 3075 3069 -6 buffer_print 612 603 -9 expand_args 159 144 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 9/-30) Total: -21 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/less.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/miscutils/less.c b/miscutils/less.c
index 2204b1cec..e24500591 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -839,13 +839,13 @@ static void print_found(const char *line)
839 goto start; 839 goto start;
840 840
841 while (match_status == 0) { 841 while (match_status == 0) {
842 char *new = xasprintf("%s%.*s"HIGHLIGHT"%.*s"NORMAL, 842 xasprintf_inplace(growline,
843 growline ? growline : "", 843 "%s%.*s"HIGHLIGHT"%.*s"NORMAL,
844 (int)match_structs.rm_so, str, 844 growline ? growline : "",
845 (int)(match_structs.rm_eo - match_structs.rm_so), 845 (int)match_structs.rm_so,
846 str + match_structs.rm_so); 846 str,
847 free(growline); 847 (int)(match_structs.rm_eo - match_structs.rm_so),
848 growline = new; 848 str + match_structs.rm_so);
849 str += match_structs.rm_eo; 849 str += match_structs.rm_eo;
850 line += match_structs.rm_eo; 850 line += match_structs.rm_eo;
851 eflags = REG_NOTBOL; 851 eflags = REG_NOTBOL;