diff options
| author | Karel Zak <kzak@redhat.com> | 2025-06-30 11:15:30 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2025-06-30 11:21:06 +0200 |
| commit | d42e5e4bc355277b820d98768e2fda52e2d08e76 (patch) | |
| tree | a557e44e6f7d10c6979e5172292744fcf01472c5 | |
| parent | c128ee3ea488174230065f6a35286e01e98996f8 (diff) | |
| download | util-linux-d42e5e4bc355277b820d98768e2fda52e2d08e76.tar.gz | |
lib/strutils: add ul_ prefix to strappend() functions
Addresses: https://github.com/util-linux/util-linux/issues/3626
Signed-off-by: Karel Zak <kzak@redhat.com>
| -rw-r--r-- | include/strutils.h | 4 | ||||
| -rw-r--r-- | include/xalloc.h | 4 | ||||
| -rw-r--r-- | lib/strutils.c | 8 | ||||
| -rw-r--r-- | libmount/src/fs.c | 2 | ||||
| -rw-r--r-- | libmount/src/tab.c | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/include/strutils.h b/include/strutils.h index db95f79cb8..73aba59750 100644 --- a/include/strutils.h +++ b/include/strutils.h @@ -461,10 +461,10 @@ 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); +extern int ul_strappend(char **a, const char *b); extern int strfappend(char **a, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); -extern int strvfappend(char **a, const char *format, va_list ap) +extern int ul_strvfappend(char **a, const char *format, va_list ap) __attribute__ ((__format__ (__printf__, 2, 0))); extern const char *split(const char **state, size_t *l, const char *separator, int quoted); diff --git a/include/xalloc.h b/include/xalloc.h index 2d13d54b93..c620a4921d 100644 --- a/include/xalloc.h +++ b/include/xalloc.h @@ -139,7 +139,7 @@ int xvasprintf(char **strp, const char *fmt, va_list ap) static inline void xstrappend(char **a, const char *b) { - if (strappend(a, b) < 0) + if (ul_strappend(a, b) < 0) err(XALLOC_EXIT_CODE, "cannot allocate string"); } @@ -153,7 +153,7 @@ static inline __attribute__((__format__(printf, 2, 0))) int xstrvfappend(char **a, const char *format, va_list ap) { - int ret = strvfappend(a, format, ap); + int ret = ul_strvfappend(a, format, ap); if (ret < 0) err(XALLOC_EXIT_CODE, "cannot allocate string"); diff --git a/lib/strutils.c b/lib/strutils.c index f25d8aba1d..c686feafe0 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -1019,7 +1019,7 @@ char *ul_strfconcat(const char *s, const char *format, ...) return res; } -int strappend(char **a, const char *b) +int ul_strappend(char **a, const char *b) { size_t al, bl; char *tmp; @@ -1051,13 +1051,13 @@ int strfappend(char **a, const char *format, ...) int res; va_start(ap, format); - res = strvfappend(a, format, ap); + res = ul_strvfappend(a, format, ap); va_end(ap); return res; } -extern int strvfappend(char **a, const char *format, va_list ap) +extern int ul_strvfappend(char **a, const char *format, va_list ap) { char *val; int sz; @@ -1067,7 +1067,7 @@ extern int strvfappend(char **a, const char *format, va_list ap) if (sz < 0) return -errno; - res = strappend(a, val); + res = ul_strappend(a, val); free(val); return res; } diff --git a/libmount/src/fs.c b/libmount/src/fs.c index c01c313b11..64c7ee865c 100644 --- a/libmount/src/fs.c +++ b/libmount/src/fs.c @@ -1668,7 +1668,7 @@ int mnt_fs_append_comment(struct libmnt_fs *fs, const char *comm) if (!fs) return -EINVAL; - return strappend(&fs->comment, comm); + return ul_strappend(&fs->comment, comm); } /** diff --git a/libmount/src/tab.c b/libmount/src/tab.c index bde55b73d7..4209d697a5 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -318,7 +318,7 @@ int mnt_table_append_intro_comment(struct libmnt_table *tb, const char *comm) { if (!tb) return -EINVAL; - return strappend(&tb->comm_intro, comm); + return ul_strappend(&tb->comm_intro, comm); } /** @@ -359,7 +359,7 @@ int mnt_table_append_trailing_comment(struct libmnt_table *tb, const char *comm) { if (!tb) return -EINVAL; - return strappend(&tb->comm_tail, comm); + return ul_strappend(&tb->comm_tail, comm); } /** |
