summaryrefslogtreecommitdiffstats
path: root/libmount/src/optstr.c
diff options
context:
space:
mode:
authorKarel Zak2012-12-04 14:22:39 +0100
committerKarel Zak2012-12-04 14:22:39 +0100
commitba2bdf41c436640286df40529cddede46b3ba5d8 (patch)
tree2fd343c6a2450b4566ca996ff2f0c9703bc2e680 /libmount/src/optstr.c
parentlibblkid: re-read PART{UUID,LABEL} for successfully verified cached devices (diff)
downloadkernel-qcow2-util-linux-ba2bdf41c436640286df40529cddede46b3ba5d8.tar.gz
kernel-qcow2-util-linux-ba2bdf41c436640286df40529cddede46b3ba5d8.tar.xz
kernel-qcow2-util-linux-ba2bdf41c436640286df40529cddede46b3ba5d8.zip
libmount: clean nonnull attribute usage
- use __attribute__((nonnull) for functions where we not able to return an return code ("is", "has" and some "get" functions). - use __attribute__((nonnull) for small functions where we always modify any of the function argument (some mnt_optstr_* functions) Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/optstr.c')
-rw-r--r--libmount/src/optstr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c
index 16d6d13a2..d0072447b 100644
--- a/libmount/src/optstr.c
+++ b/libmount/src/optstr.c
@@ -166,7 +166,8 @@ int mnt_optstr_next_option(char **optstr, char **name, size_t *namesz,
return mnt_optstr_parse_next(optstr, name, namesz, value, valuesz);
}
-static int __mnt_optstr_append_option(char **optstr,
+static int __attribute__((nonnull))
+__mnt_optstr_append_option(char **optstr,
const char *name, size_t nsz,
const char *value, size_t vsz)
{
@@ -356,7 +357,8 @@ int mnt_optstr_remove_option_at(char **optstr, char *begin, char *end)
}
/* insert 'substr' or '=substr' to @str on position @pos */
-static int insert_value(char **str, char *pos, const char *substr, char **next)
+static int __attribute__((nonnull(1,2,3)))
+insert_value(char **str, char *pos, const char *substr, char **next)
{
size_t subsz = strlen(substr); /* substring size */
size_t strsz = strlen(*str);