summaryrefslogtreecommitdiffstats
path: root/XUtils.h
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Add xReallocArrayZero() helperChristian Göttsche2021-09-111-0/+2
| | | | | Add helper function to reallocate an dynamic allocated array including zeroing the newly allocated memory.
* XUtils: move implementation of String_contains_i out of header fileChristian Göttsche2021-08-251-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The function strcasestr(3) is only available if _GNU_SOURCE is defined. If any file includes <string.h> before declaring _GNU_SOURCE, e.g by including "config.h", compilation fails with the following error: In file included from ColumnsPanel.c:8: In file included from ./ColumnsPanel.h:12: In file included from ./Panel.h:13: In file included from ./CRT.h:16: In file included from ./Settings.h:17: In file included from ./Process.h:15: In file included from ./Object.h:17: ./XUtils.h:42:11: error: implicit declaration of function 'strcasestr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return strcasestr(s1, s2) != NULL; ^ ./XUtils.h:42:11: note: did you mean 'strcasecmp'? /usr/include/strings.h:116:12: note: 'strcasecmp' declared here extern int strcasecmp (const char *__s1, const char *__s2) ^ Move the implementation to avoid unnecessary includes. Since LTO is quite common and stable performance should not be impacted if used.
* Pointer indication aligned to typenameBenny Baumann2021-07-151-1/+1
|
* Add compiler hints on memory allocating utility functionsChristian Göttsche2021-01-111-11/+11
|
* Add wrapper function for free and strdupChristian Göttsche2021-01-111-0/+1
| | | | Reduces code in callers and helps avoiding memory leaks.
* XUtils: add safe strncpy implementationChristian Göttsche2021-01-111-0/+3
| | | | | The standard strncpy fails to null-terminate the destination in case the source is longer than the passed size.
* XUtils: check for multiplication overflow in allocation sizeChristian Göttsche2021-01-021-0/+4
|
* Use size_t as len type for xSnprintfChristian Göttsche2020-12-061-1/+1
| | | | Like the C snprintf function
* IWYU updateChristian Göttsche2020-12-061-0/+1
|
* Add xReadfile wrapper for reading small to medium size filesChristian Göttsche2020-12-021-0/+4
| | | | | | Inspired by proposed Linux syscall Avoid file descriptor leaks like 4af8c63f
* Spacing around operatorsBenny Baumann2020-11-021-2/+2
|
* XUtils string related updatesChristian Göttsche2020-10-191-7/+16
| | | | | | | | | | - allow count out-parameter of String_split() to be NULL - introduce xStrndup() - do not allow NULL pointers passed to String_eq() it is not used in any code - implement String_startsWith(), String_contains_i() and String_eq() as inline header functions - adjust several conversion issues
* Make all required includes explicitBenny Baumann2020-10-181-3/+4
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* Combine XAlloc.[ch] into XUtils.[ch]Benny Baumann2020-10-171-0/+11
|
* Rename StringUtils.[ch] to XUtils.[ch]Benny Baumann2020-10-161-0/+45

© 2014-2024 Faster IT GmbH | imprint | privacy policy