summaryrefslogtreecommitdiff
path: root/src/test/test-string-util.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* string-util: add delete_trailing_chars() and skip_leading_chars() helpersLennart Poettering2017-11-131-4/+42
| | | | And let's port over a couple of users to the new APIs.
* string-util: add strlen_ptr() helperLennart Poettering2017-07-311-0/+7
| | | | | strlen_ptr() is to strlen() what streq_ptr() is to streq(): i.e. it handles NULL strings in a smart way.
* treewide: replace homegrown memory_erase with explicit_bzeroZbigniew Jędrzejewski-Szmek2017-02-051-23/+12
| | | | | | | | explicit_bzero was added in glibc 2.25. Make use of it. explicit_bzero is hardcoded to zero the memory, so string erase now truncates the string, instead of overwriting it with 'x'. This causes a visible difference only in the journalctl case.
* Drop FOREACH_WORD_QUOTEDZbigniew Jędrzejewski-Szmek2016-11-051-11/+15
|
* tests: move string related tests to test-string-util.cRonny Chevalier2016-03-031-0/+265
|
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* basic: add ascii_strcasecmp_nn() callLennart Poettering2016-01-131-0/+18
| | | | | In contrast to ascii_strcasecmp_nn() it takes two character buffers with their individual length. It will then compare the buffers up the smaller size of the two buffers, and finally the length themselves.
* basic: add new ascii_strcasecmp_n() callLennart Poettering2016-01-131-0/+28
|
* string-util: rework memory_erase() so that it cannot be optimized awayLennart Poettering2015-11-021-0/+61
memory_erase() so far just called memset(), which the compiler might optimize away under certain conditions if it feels there's benefit in it. C11 knows a new memset_s() call that is like memset(), but may not be optimized away. Ideally, we'd just use that call, but glibc currently does not support it. Hence, implement our own simplistic version of it. We use a GCC pragma to turn off optimization for this call, and also use the "volatile" keyword on the pointers to ensure that gcc will use the pointers as-is. According to a variety of internet sources, either one does the trick. However, there are also reports that at least the volatile thing isn't fully correct, hence let's add some snake oil and employ both techniques. https://news.ycombinator.com/item?id=4711346