diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-05-30 04:07:37 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-14 08:18:59 +0200 |
| commit | ab50d908ba2eae14929a07341b1b716cde681c1c (patch) | |
| tree | 52e3f1f8cd579eb234185dc3b397ac66cda47cbf /deps/ae/util.h | |
| parent | 46f9e7c67134caf43a04ea5ee3b2325588647e28 (diff) | |
| download | ffwd-ab50d908ba2eae14929a07341b1b716cde681c1c.tar.gz ffwd-ab50d908ba2eae14929a07341b1b716cde681c1c.zip | |
server: implement HTTP API with libae integration
Diffstat (limited to 'deps/ae/util.h')
| -rw-r--r-- | deps/ae/util.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/deps/ae/util.h b/deps/ae/util.h new file mode 100644 index 0000000..630c4ca --- /dev/null +++ b/deps/ae/util.h @@ -0,0 +1,21 @@ +/* util.h - minimal utilities needed by anet */ +#ifndef __UTIL_H +#define __UTIL_H + +#include <string.h> + +/* Simple error buffer size */ +#define ANET_ERR_LEN 256 + +/* Safe string copy - simplified version */ +static inline size_t redis_strlcpy(char *dst, const char *src, size_t dsize) { + size_t len = strlen(src); + if (dsize > 0) { + size_t copy_len = (len >= dsize) ? dsize - 1 : len; + memcpy(dst, src, copy_len); + dst[copy_len] = '\0'; + } + return len; +} + +#endif |
