aboutsummaryrefslogtreecommitdiff
path: root/dynstr.c
Commit message (Collapse)AuthorAgeFilesLines
* dynstr.c: Fix memory leak if realloc(3) failsXavier Del Campo Romero2023-03-081-15/+17
| | | | | | | | | | According to C99 ยง7.20.3.4: If memory for the new object cannot be allocated, the old object is not deallocated and its value is unchanged. Therefore, a temporary pointer must be used to ensure the original object can still be deallocated should realloc(3) return a null pointer.
* dynstr.c: Make zero-initialization portableXavier Del Campo Romero2023-03-081-1/+1
|
* Update copyright noticeXavier Del Campo Romero2023-03-081-1/+1
|
* Fix lifetime issues with va_listXavier Del Campo Romero2020-10-141-34/+53
| | | | | | | The standard requires both va_start and va_end to be called from the same function. On the other hand, vsnprintf and vsprintf leave the va_list on an undefined state according to the standard, so a copy must be created before a second call to these functions.
* Add dynstr_vprependXavier Del Campo Romero2020-10-081-32/+29
|
* Add dynstr_vappendXavier Del Campo Romero2020-10-061-20/+21
|
* Call dynstr_init on dynstr_freeXavier Del Campo Romero2020-09-031-1/+1
|
* dynstr_prepend(), fixed typo in commentXavier Del Campo Romero2020-08-031-0/+45
|
* Various minor changesXavier Del Campo Romero2020-06-121-0/+4
| | | | | | | | - Removed trailing ';' from convenience macros. - Convenience macros did not really need the ## __VA_ARGS__ extension. Simply grouping all parameters into '...', while decreasing readability, solves the portability issue. - Added C99 check to dynstr.c.
* Avoid free() if no string is presentXavier Del Campo Romero2020-03-251-2/+5
|
* Various changes and improvementsXaviDCR922020-03-211-14/+37
| | | | | | - Replaced int by specific, more meaningful error codes. - C99 states realloc can be safely called using NULL pointers. - New function dynstr_dup().
* Solved compiler error by adding scope blockXavi Del Campo2020-03-211-22/+25
|
* Replaced unneeded calloc() by malloc()Xavier Del Campo Romero2020-03-201-2/+2
|
* First commitXavi Del Campo2020-03-191-0/+68