lbutils: rename mkrbuf to rmalloc

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-29 08:37:32 +01:00
parent 6e4839d356
commit 45edcf33f7
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -396,9 +396,9 @@ int dcat(const char *s, size_t n,
unsigned short hextonum(char ch_s);
void spew_hex(const void *data, size_t len);
void *mkrbuf(size_t n);
void *rmalloc(size_t n);
void rset(void *buf, size_t n);
void *mkrbuf(size_t n);
void *rmalloc(size_t n);
char *mkrstr(size_t n);
size_t rsize(size_t n);
+4 -4
View File
@@ -92,12 +92,12 @@ mkrstr(size_t n) /* emulates spkmodem-decode */
size_t i;
if (n == 0)
err_exit(EPERM, "mkrbuf: zero-byte request");
err_exit(EPERM, "rmalloc: zero-byte request");
if (n >= SIZE_MAX - 1)
err_exit(EOVERFLOW, "mkrbuf: overflow");
err_exit(EOVERFLOW, "rmalloc: overflow");
if (if_err((s = mkrbuf(n + 1)) == NULL, EFAULT))
if (if_err((s = rmalloc(n + 1)) == NULL, EFAULT))
err_exit(EFAULT, "mkrstr: null");
for (i = 0; i < n; i++)
@@ -110,7 +110,7 @@ mkrstr(size_t n) /* emulates spkmodem-decode */
}
void *
mkrbuf(size_t n)
rmalloc(size_t n)
{
void *buf = NULL;
rset(vmalloc(&buf, n), n);
+1 -1
View File
@@ -27,7 +27,7 @@ main(int argc, char **argv)
/* https://man.openbsd.org/pledge.2 */
xpledgex("stdio", NULL);
buf = mkrbuf(BUFSIZ);
buf = rmalloc(BUFSIZ);
if (!memcmp(buf, buf + (BUFSIZ >> 1), BUFSIZ >> 1))
same = 1;