summaryrefslogtreecommitdiff
path: root/userland/libc/stdlib
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-10-13 13:33:29 +0200
committerAnton Kling <anton@kling.gg>2024-10-13 13:34:01 +0200
commita67d4744d78fc58846f29667ae49cee70fa0bf16 (patch)
tree848dc06f4cf19d4a6560b7bea604d8177f06e7f7 /userland/libc/stdlib
parentedca64134a9873f32379b2b83bd925ecca1c19b1 (diff)
libc/sb: Refactor string builder to allow for none malloc allocations
A lot of code written usually has means of doing allocations in a more optimal way than having the string builder library doing it itself. For example a temporary buffer can be allocated on the stack and the string builder functions can then make use of this buffer without ever having to run malloc/free(which would be expensive)
Diffstat (limited to 'userland/libc/stdlib')
-rw-r--r--userland/libc/stdlib/realpath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/userland/libc/stdlib/realpath.c b/userland/libc/stdlib/realpath.c
index 7ce0f6c..86ac4ed 100644
--- a/userland/libc/stdlib/realpath.c
+++ b/userland/libc/stdlib/realpath.c
@@ -16,7 +16,7 @@ char *realpath(const char *filename, char *resolvedname) {
strcat(cwd, filename); // FIXME: bounds check
struct sb string;
- sb_init(&string, 512);
+ sb_init_capacity(&string, 256);
struct sv path = C_TO_SV(cwd);