diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-04-21 11:36:06 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-04-28 14:20:04 +0200 |
commit | 39fd620b83b45e6b9f85c5a988e4a63e916000dc (patch) | |
tree | bd77e29c40bf45da4cce524f929e1a6324dbf982 /src/libdt.c | |
parent | 9f4fe5392895ef7d0a093cf793c6c2104d5093cb (diff) | |
download | dt-utils-39fd620b83b45e6b9f85c5a988e4a63e916000dc.tar.gz dt-utils-39fd620b83b45e6b9f85c5a988e4a63e916000dc.tar.xz |
libdt: fix printf related bugs
src/libdt.c:97:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
printf(data);
^~~~
src/libdt.c:2241:5: warning: data argument not used by format string [-Wformat-extra-args]
node->full_name);
^
src/libdt.c:2248:54: warning: more '%' conversions than data arguments [-Wformat]
fprintf(stderr, "%s: no 'label' property found in %s\n", partition_node->full_name);
~^
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'src/libdt.c')
-rw-r--r-- | src/libdt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libdt.c b/src/libdt.c index 7236429..50f0da8 100644 --- a/src/libdt.c +++ b/src/libdt.c @@ -94,7 +94,7 @@ void of_print_property(const void *data, int len) while (j < len) { if (j > 0) printf("\", \""); - printf(data); + printf("%s", data); j += strlen(data) + 1; data += strlen(data) + 1; } @@ -2237,7 +2237,7 @@ int of_get_devicepath(struct device_node *partition_node, char **devpath, off_t dev = of_find_device_by_node_path(node->full_name); if (!dev) { - fprintf(stderr, "cannot find device from node %s", __func__, + fprintf(stderr, "%s: cannot find device from node %s", __func__, node->full_name); return -ENODEV; } @@ -2245,7 +2245,8 @@ int of_get_devicepath(struct device_node *partition_node, char **devpath, off_t /* find the name of the partition... */ ret = of_property_read_string(partition_node, "label", &partname); if (ret) { - fprintf(stderr, "%s: no 'label' property found in %s\n", partition_node->full_name); + fprintf(stderr, "%s: no 'label' property found in %s\n", __func__, + partition_node->full_name); return ret; } |