From 3c52a756339a2d96824d21a7d3ad5de7fc1085a0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 27 Mar 2025 17:26:51 -0400 Subject: 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. --- examples/commands/commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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*)); -- cgit v1.2.3