summaryrefslogtreecommitdiffstats
path: root/libblkid/src/tag.c
diff options
context:
space:
mode:
authorKarel Zak2012-11-30 10:56:54 +0100
committerKarel Zak2012-11-30 10:56:54 +0100
commite0a9b8cf2d7a2f0264332fbc870341103840ed06 (patch)
treef90a7e6230176b90ee4448a994b0c1dd5d489646 /libblkid/src/tag.c
parentlibblkid: add function attributes to private API (diff)
downloadkernel-qcow2-util-linux-e0a9b8cf2d7a2f0264332fbc870341103840ed06.tar.gz
kernel-qcow2-util-linux-e0a9b8cf2d7a2f0264332fbc870341103840ed06.tar.xz
kernel-qcow2-util-linux-e0a9b8cf2d7a2f0264332fbc870341103840ed06.zip
libblkid: remove blkid_{strndup,strdup}
Don't try to be smart. Let's use standard libc functions. (Note that we have fallback for strndup() in include/strutils.h) Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/tag.c')
-rw-r--r--libblkid/src/tag.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libblkid/src/tag.c b/libblkid/src/tag.c
index efe67cb29..8fe333634 100644
--- a/libblkid/src/tag.c
+++ b/libblkid/src/tag.c
@@ -136,7 +136,7 @@ int blkid_set_tag(blkid_dev dev, const char *name,
if (!dev || !name)
return -BLKID_ERR_PARAM;
- if (value && !(val = blkid_strndup(value, vlength)))
+ if (value && !(val = strndup(value, vlength)))
return -BLKID_ERR_MEM;
/*
@@ -167,7 +167,7 @@ int blkid_set_tag(blkid_dev dev, const char *name,
/* Existing tag not present, add to device */
if (!(t = blkid_new_tag()))
goto errout;
- t->bit_name = blkid_strdup(name);
+ t->bit_name = name ? strdup(name) : NULL;
t->bit_val = val;
t->bit_dev = dev;
@@ -183,7 +183,7 @@ int blkid_set_tag(blkid_dev dev, const char *name,
DBG(DEBUG_TAG,
printf(" creating new cache tag head %s\n", name));
- head->bit_name = blkid_strdup(name);
+ head->bit_name = name ? strdup(name) : NULL;
if (!head->bit_name)
goto errout;
list_add_tail(&head->bit_tags,
@@ -231,7 +231,7 @@ int blkid_parse_tag_string(const char *token, char **ret_type, char **ret_val)
if (!token || !(cp = strchr(token, '=')))
return -1;
- name = blkid_strdup(token);
+ name = strdup(token);
if (!name)
return -1;
value = name + (cp - token);
@@ -242,7 +242,7 @@ int blkid_parse_tag_string(const char *token, char **ret_type, char **ret_val)
goto errout; /* missing closing quote */
*cp = '\0';
}
- value = blkid_strdup(value);
+ value = strdup(value);
if (!value)
goto errout;