[netcf-devel] [PATCH 1/4] Mark xasprintf as printf-like
David Lutterkort
lutter at redhat.com
Tue Sep 15 23:44:36 UTC 2009
* src/dutil.h (xasprintf): mark with printf attribute
* src/dutil_linux.c (modprobed_alias_bond): remove extraneous
argument to xasprintf
---
src/dutil.h | 1 +
src/dutil_linux.c | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/dutil.h b/src/dutil.h
index fc86e00..7e04a24 100644
--- a/src/dutil.h
+++ b/src/dutil.h
@@ -49,6 +49,7 @@ struct augeas_xfm_table {
};
/* Like asprintf, but set *STRP to NULL on error */
+ATTRIBUTE_FORMAT(printf, 2, 3)
int xasprintf(char **strp, const char *format, ...);
/* Add a table of transformations that the next GET_AUGEAS should run */
diff --git a/src/dutil_linux.c b/src/dutil_linux.c
index 47e6717..b728f5f 100644
--- a/src/dutil_linux.c
+++ b/src/dutil_linux.c
@@ -111,8 +111,7 @@ void modprobed_alias_bond(struct netcf *ncf, const char *name) {
if (nmatches == 0) {
/* Add a new alias node; this probably deserves better API support
in Augeas, it's too convoluted */
- r = xasprintf(&path,
- "/files/etc/modprobe.d/netcf.conf/alias[last()]", name);
+ r = xasprintf(&path, "/files/etc/modprobe.d/netcf.conf/alias[last()]");
ERR_NOMEM(r < 0, ncf);
nmatches = aug_match(aug, path, NULL);
if (nmatches > 0) {
--
1.6.2.5
More information about the netcf-devel
mailing list