aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-27 17:26:51 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-27 17:26:51 -0400
commit3c52a756339a2d96824d21a7d3ad5de7fc1085a0 (patch)
treee5299a25ebb76186d6372b700710d7c8c7fe0728 /examples
parent2186e84de0c0fd47ba48eaa35f74ea2754c3b81f (diff)
Deprecate custom printf specifiers in favor of print() function that
uses _Generic() to generically convert any value to a string or print as a string.
Diffstat (limited to 'examples')
-rw-r--r--examples/commands/commands.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/commands/commands.c b/examples/commands/commands.c
index ec090a7b..f823eeb0 100644
--- a/examples/commands/commands.c
+++ b/examples/commands/commands.c
@@ -73,7 +73,7 @@ int run_command(Text_t exe, Array_t arg_array, Table_t env_table,
for (int64_t i = 0; i < env_table.entries.length; i++) {
struct { Text_t key, value; } *entry = env_table.entries.data + env_table.entries.stride*i;
- const char *env_entry = heap_strf("%k=%k", &entry->key, &entry->value);
+ const char *env_entry = String(entry->key, "=", entry->value);
Array$insert(&env_array, &env_entry, I(0), sizeof(char*));
}
Array$insert_value(&env_array, NULL, I(0), sizeof(char*));
@@ -254,7 +254,7 @@ OptionalClosure_t command_by_line(Text_t exe, Array_t arg_array, Table_t env_tab
for (int64_t i = 0; i < env_table.entries.length; i++) {
struct { Text_t key, value; } *entry = env_table.entries.data + env_table.entries.stride*i;
- const char *env_entry = heap_strf("%k=%k", &entry->key, &entry->value);
+ const char *env_entry = String(entry->key, "=", entry->value);
Array$insert(&env_array, &env_entry, I(0), sizeof(char*));
}
Array$insert_value(&env_array, NULL, I(0), sizeof(char*));