search for: out1mem

Displaying 4 results from an estimated 4 matches for "out1mem".

2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Handle embedded NULs correctly in printf
...e_str(s, &p); + q = stackblock(); + len = p - q; + + p = makestrspace(len, p); + memset(p, 'X', len - 1); + p[len - 1] = 0; + + q = stackblock(); + total = ASPF(&p, f, p); + + len = strchrnul(p, 'X') - p; + memcpy(p + len, q, strchrnul(p + len, ' ') - (p + len)); + + out1mem(p, total); + + popstackmark(&smark); + return done; +} + + int printfcmd(int argc, char *argv[]) { char *fmt; @@ -156,17 +203,14 @@ pc: fmt[1] = 0; switch (ch) { - case 'b': { - int done = conv_escape_str(getstr()); - char *p = stackblock(); + case 'b':...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Handle embedded NULs correctly in printf
...e_str(s, &p); + q = stackblock(); + len = p - q; + + p = makestrspace(len, p); + memset(p, 'X', len - 1); + p[len - 1] = 0; + + q = stackblock(); + total = ASPF(&p, f, p); + + len = strchrnul(p, 'X') - p; + memcpy(p + len, q, strchrnul(p + len, ' ') - (p + len)); + + out1mem(p, total); + + popstackmark(&smark); + return done; +} + + int printfcmd(int argc, char *argv[]) { char *fmt; @@ -156,17 +203,14 @@ pc: fmt[1] = 0; switch (ch) { - case 'b': { - int done = conv_escape_str(getstr()); - char *p = stackblock(); + case 'b':...
2019 Jan 25
0
[klibc:update-dash] builtin: Fix echo performance regression
...p = makestrspace(len, q); + memset(p, 'X', total); + p[total] = 0; q = stackblock(); total = ASPF(&p, f, p); len = strchrnul(p, 'X') - p; - memcpy(p + len, q, strchrnul(p + len, ' ') - (p + len)); + memcpy(p + len, q, strspn(p + len, "X")); +easy: out1mem(p, total); popstackmark(&smark);
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Fix echo performance regression
...p = makestrspace(len, q); + memset(p, 'X', total); + p[total] = 0; q = stackblock(); total = ASPF(&p, f, p); len = strchrnul(p, 'X') - p; - memcpy(p + len, q, strchrnul(p + len, ' ') - (p + len)); + memcpy(p + len, q, strspn(p + len, "X")); +easy: out1mem(p, total); popstackmark(&smark);