Skip to content

Commit

Permalink
weechat_prefix always return a string
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerl13 committed Dec 21, 2020
1 parent 757c35b commit dd23f04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/api/bindings_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@
value caml_weechat_prefix(value prefix) {
CAMLparam1(prefix);
CAMLlocal1(res);
const char* p = weechat_prefix(String_val(prefix));
if (p) {
res = caml_alloc(1, 0);
Store_field(res, 0, caml_copy_string(p));
} else {
res = Val_int(0);
}
res = caml_copy_string(weechat_prefix(String_val(prefix)));
CAMLreturn(res);
}

Expand Down
2 changes: 1 addition & 1 deletion src/api/weechat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type gui_buffer

(** {2 13. Display} *)

external prefix: string -> string option = "caml_weechat_prefix"
external prefix: string -> string = "caml_weechat_prefix"
external printf: gui_buffer -> string -> unit = "caml_weechat_printf"
let printf buffer = Format.kasprintf (printf buffer)

Expand Down

0 comments on commit dd23f04

Please sign in to comment.