Skip to content

Commit

Permalink
Use constant format strings for all printfs
Browse files Browse the repository at this point in the history
To avoid accidental collision of the input with format specifiers like
%s.
  • Loading branch information
anko committed May 1, 2021
1 parent bbc520f commit 822e13c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ int main(int argc, char **argv) {
GType type = prop->value_type;

printf(" • ");
printf(prop->name);
printf("%s", prop->name);

if (g_type_is_a(type, G_TYPE_BOOLEAN)) {
bool v;
Expand All @@ -481,14 +481,14 @@ int main(int argc, char **argv) {
g_type_class_ref(type);
for (int j = 0; j < enum_class->n_values; ++j) {
GEnumValue enum_value = enum_class->values[j];
printf(enum_value.value_nick);
printf("%s", enum_value.value_nick);
if (j < enum_class->n_values - 1) printf("|");
}
gint v;
g_object_get(wk_settings, prop->name, &v, NULL);
printf(" (%s)",
g_enum_get_value(enum_class, v)->value_nick);
} else printf(g_type_name(type));
} else printf("%s", g_type_name(type));

if (prop->flags & G_PARAM_DEPRECATED)
printf( " [⚠ DEPRECATED]");
Expand Down

0 comments on commit 822e13c

Please sign in to comment.