mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-08-21 21:07:20 +00:00
8f22adc423
The musl-libc library provides implementations of strlcpy and strlcat, so introduce a feature check for it and only use the kvmtool implementation if there is no library support for it. This avoids clashes with the public definition. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
23 lines
500 B
C
23 lines
500 B
C
#ifndef __STRBUF_H__
|
|
#define __STRBUF_H__
|
|
|
|
#include <sys/types.h>
|
|
#include <string.h>
|
|
|
|
int prefixcmp(const char *str, const char *prefix);
|
|
|
|
#ifndef HAVE_STRLCPY
|
|
extern size_t strlcat(char *dest, const char *src, size_t count);
|
|
extern size_t strlcpy(char *dest, const char *src, size_t size);
|
|
#endif
|
|
|
|
/* some inline functions */
|
|
|
|
static inline const char *skip_prefix(const char *str, const char *prefix)
|
|
{
|
|
size_t len = strlen(prefix);
|
|
return strncmp(str, prefix, len) ? NULL : str + len;
|
|
}
|
|
|
|
#endif
|