}
#ifdef TEST_PROGRAM
+#include "xalloc.h"
static int test_append(struct libmnt_test *ts, int argc, char *argv[])
{
if (argc < 3)
return -EINVAL;
- optstr = strdup(argv[1]);
+ optstr = xstrdup(argv[1]);
name = argv[2];
if (argc == 4)
if (argc < 3)
return -EINVAL;
- optstr = strdup(argv[1]);
+ optstr = xstrdup(argv[1]);
name = argv[2];
if (argc == 4)
if (argc < 2)
return -EINVAL;
- optstr = strdup(argv[1]);
+ optstr = xstrdup(argv[1]);
rc = mnt_split_optstr(optstr, &user, &vfs, &fs, 0, 0);
if (!rc) {
if (argc < 2)
return -EINVAL;
- optstr = strdup(argv[1]);
+ optstr = xstrdup(argv[1]);
rc = mnt_optstr_get_flags(optstr, &fl, mnt_get_builtin_optmap(MNT_LINUX_MAP));
if (rc)
return -EINVAL;
}
- optstr = strdup(argv[2]);
+ optstr = xstrdup(argv[2]);
flags = strtoul(argv[3], NULL, 16);
printf("flags: 0x%08lx\n", flags);
if (argc < 3)
return -EINVAL;
- optstr = strdup(argv[1]);
+ optstr = xstrdup(argv[1]);
name = argv[2];
if (argc == 4)
if (argc < 3)
return -EINVAL;
- optstr = strdup(argv[1]);
+ optstr = xstrdup(argv[1]);
name = argv[2];
rc = mnt_optstr_remove_option(&optstr, name);
if (argc < 3)
return -EINVAL;
- optstr = strdup(argv[1]);
+ optstr = xstrdup(argv[1]);
name = argv[2];
rc = mnt_optstr_deduplicate_option(&optstr, name);
if (argc < 2)
return -EINVAL;
- next = optstr = strdup(argv[1]);
+ next = optstr = xstrdup(argv[1]);
printf("optstr: %s\n", optstr);