diff options
| author | Tyge Løvset <[email protected]> | 2022-04-18 00:44:51 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-04-18 00:44:51 +0200 |
| commit | 00804d9ff488f63468a0bb528c7b807aea7c3ea3 (patch) | |
| tree | 51b47787adc853bd1a10ec820a6ef5c184fa2498 /examples/utf8replace_c.c | |
| parent | 4436a1c0ac37dc2e73a2134d5ad85c010340b35d (diff) | |
| download | STC-modified-00804d9ff488f63468a0bb528c7b807aea7c3ea3.tar.gz STC-modified-00804d9ff488f63468a0bb528c7b807aea7c3ea3.zip | |
Converted all example to use cstr_str(&s) instead of s.str to allow SSO string. Fixed misc warnings.
Diffstat (limited to 'examples/utf8replace_c.c')
| -rw-r--r-- | examples/utf8replace_c.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/utf8replace_c.c b/examples/utf8replace_c.c index 49680ecd..5ca51d22 100644 --- a/examples/utf8replace_c.c +++ b/examples/utf8replace_c.c @@ -5,14 +5,14 @@ int main() { c_auto (cstr, hello) { hello = cstr_new("hell😀 world"); - printf("%s\n", hello.str); + printf("%s\n", cstr_str(&hello)); cstr_replace_sv( &hello, - utf8_substr(hello.str, 4, 1), + utf8_substr(cstr_str(&hello), 4, 1), c_sv("🐨") ); - printf("%s\n", hello.str); + printf("%s\n", cstr_str(&hello)); csview sv = csview_from_s(&hello); c_foreach (c, csview, sv) |
