#ifdef KERNEL_32BIT
typedef uint32_t kernel_uint_t;
-#define str2kernel_unit_t(string) str2uint32_t(string)
+#define str2kernel_uint_t(string) str2uint32_t(string)
#define KERNEL_UINT_FORMAT "%u"
#else
typedef uint64_t kernel_uint_t;
-#define str2kernel_unit_t(string) str2uint64_t(string)
+#define str2kernel_uint_t(string) str2uint64_t(string)
#define KERNEL_UINT_FORMAT "%" PRIu64
#endif
#undef strcmp
#endif
#define strcmp(a, b) strsame(a, b)
+#endif // NETDATA_STRCMP_OVERRIDE
+
static inline int strsame(const char *a, const char *b) {
if(unlikely(a == b)) return 0;
while(*a && *a == *b) { a++; b++; }
return *a - *b;
}
-#endif // NETDATA_STRSAME
+
+static inline char *strncpyz(char *dst, const char *src, size_t n) {
+ char *p = dst;
+
+ while (*src && n--)
+ *dst++ = *src++;
+
+ *dst = '\0';
+
+ return p;
+}
static inline int read_single_number_file(const char *filename, unsigned long long *result) {
char buffer[30 + 1];