sds icon indicating copy to clipboard operation
sds copied to clipboard

Simple Dynamic Strings library for C

Results 108 sds issues
Sort by recently updated
recently updated
newest added

I have been messing with sds recently, and I decided to submit my changes. This is a summary of the changes: The biggest feature is the new `sdsadd` macro. By...

The value written to &oldfree (sds.c, line 1240) is never used. ```C if (type != SDS_TYPE_5) { test_cond("sdsMakeRoomFor() free", sdsavail(x) >= step); oldfree = sdsavail(x); } ``` One way to...

The README states that sdstrim returns void, but in fact it returns sds.

When compiling with [UndefinedBehaviorSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) and running the tests (`CC=clang-6.0 CFLAGS='-fsanitize=undefined'`, the following error is raised: ``` [...] 6 - sdscatprintf() seems working in the base case: PASSED sds.c:446:23: runtime error:...

I think check "if (sh == NULL) return NULL;" should be ahead, if not, core dump will happen.

There's a possible memleak and NULL ptr usage in sds.c:40 in `sdssplitargs`: ```c vector = s_realloc(vector,((*argc)+1)*sizeof(char*)); vector[*argc] = current; ``` Realloc here might return NULL and thus NULLify `vector` while...

Hi, why in sds.h you have (static inline functions)? Also why sdshdr* placed in header? I try to link sds.h into C++ project with -Wpedantic flag and receive errors like...

In the function 'sdscatvprintf' I think the statement va_end(cpy) is missing after vsnprintf call.