From 43ed5f07c1fbfe990c99587ad87b5835213720b7 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 26 Jan 2025 13:28:49 -0300 Subject: [PATCH] Fix README example using clip::lock::set_data() incorrectly (fix #82) --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a0241d6..e9695db 100644 --- a/README.md +++ b/README.md @@ -39,11 +39,12 @@ int main() { clip::register_format("com.appname.FormatName"); int value = 32; + std::string str = "Alternative text for value 32"; clip::lock l; l.clear(); - l.set_data(clip::text_format(), "Alternative text for value 32"); - l.set_data(my_format, &value, sizeof(int)); + l.set_data(clip::text_format(), str.c_str(), str.size()); + l.set_data(my_format, (const char*)&value, sizeof(int)); } ```