return NULL;
}
-extern char *strnconcat(const char *s, const char *suffix, size_t b);
-extern char *strconcat(const char *s, const char *suffix);
-extern char *strfconcat(const char *s, const char *format, ...)
+extern char *ul_strnconcat(const char *s, const char *suffix, size_t b);
+extern char *ul_strconcat(const char *s, const char *suffix);
+extern char *ul_strfconcat(const char *s, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int strappend(char **a, const char *b);
}
/* concatenate two strings to a new string, the size of the second string is limited by @b */
-char *strnconcat(const char *s, const char *suffix, size_t b)
+char *ul_strnconcat(const char *s, const char *suffix, size_t b)
{
size_t a;
char *r;
}
/* concatenate two strings to a new string */
-char *strconcat(const char *s, const char *suffix)
+char *ul_strconcat(const char *s, const char *suffix)
{
- return strnconcat(s, suffix, suffix ? strlen(suffix) : 0);
+ return ul_strnconcat(s, suffix, suffix ? strlen(suffix) : 0);
}
/* concatenate @s and string defined by @format to a new string */
-char *strfconcat(const char *s, const char *format, ...)
+char *ul_strfconcat(const char *s, const char *format, ...)
{
va_list ap;
char *val, *res;
if (sz < 0)
return NULL;
- res = strnconcat(s, val, sz);
+ res = ul_strnconcat(s, val, sz);
free(val);
return res;
}
UL_STRV_FOREACH(s, b) {
char *v;
- v = strconcat(*s, suffix);
+ v = ul_strconcat(*s, suffix);
if (!v)
return -ENOMEM;
src = mnt_fs_get_srcpath(rootfs);
if (fstype && strncmp(fstype, "nfs", 3) == 0 && root) {
/* NFS stores the root at the end of the source */
- src = src2 = strconcat(src, root);
+ src = src2 = ul_strconcat(src, root);
free(root);
root = NULL;
}
{
free(ctl->optstr);
if (*options != '+' && getenv("POSIXLY_CORRECT"))
- ctl->optstr = strconcat("+", options);
+ ctl->optstr = ul_strconcat("+", options);
else
ctl->optstr = xstrdup(options);
if (!ctl->optstr)
if (!one)
continue;
- res = strconcat(tmp, one);
+ res = ul_strconcat(tmp, one);
free(tmp);
free(one);
}
usr = strdup_structured_data_list(&ctl->user_sds);
if (sys && usr) {
- res = strconcat(sys, usr);
+ res = ul_strconcat(sys, usr);
free(sys);
free(usr);
} else
}
fclose(f);
- p->mname = strconcat("/", de->d_name);
+ p->mname = ul_strconcat("/", de->d_name);
mqd_t mq = mq_open(p->mname, O_RDONLY);
struct mq_attr attr;