We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fae8d1d commit c081268Copy full SHA for c081268
src/util/stringUtils.h
@@ -83,7 +83,7 @@ static inline bool ffCharIsDigit(char c)
83
// Copies at most (dstBufSiz - 1) bytes from src to dst; dst is always null-terminated
84
static inline char* ffStrCopy(char* __restrict__ dst, const char* __restrict__ src, size_t dstBufSiz)
85
{
86
- if (__builtin_expect(dst == NULL, false)) return dst;
+ if (__builtin_expect(dst == NULL, false) || dstBufSiz == 0) return dst;
87
88
size_t len = strnlen(src, dstBufSiz - 1);
89
memcpy(dst, src, len);
0 commit comments