diff --git a/io/sys/darwin/path.c b/io/sys/darwin/path.c index ff098d1..c420843 100644 --- a/io/sys/darwin/path.c +++ b/io/sys/darwin/path.c @@ -18,7 +18,7 @@ struct b_path { }; static void path_release(struct b_object *obj); -static void path_to_string(struct b_object *obj, struct b_stream *out); +static void path_to_string(const struct b_object *obj, struct b_stream *out); static struct b_object_type path_type = { .t_name = "corelib::path", @@ -58,7 +58,7 @@ struct b_path *b_path_create_root() b_string_append_cstr(path->pathstr, system_drive); if (system_drive[system_drive_len - 1] != '\\') { - b_string_append_cstr(path->pathstr, "\\"); + b_string_append_c(path->pathstr, '\\'); } return path; @@ -108,8 +108,7 @@ struct b_path *b_path_create_from_cstr(const char *cstr) continue; } - char s[] = {c, 0}; - b_string_append_cstr(path->pathstr, s); + b_string_append_c(path->pathstr, c); prev = c; } @@ -312,7 +311,7 @@ void path_release(struct b_object *obj) b_string_release(path->pathstr); } -void path_to_string(struct b_object *obj, struct b_stream *out) +void path_to_string(const struct b_object *obj, struct b_stream *out) { struct b_path *path = (struct b_path *)obj;