aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer2array.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong2006-08-261-6/+6
| | | | | | | | | | | | | | | | | | | I'm checking for zero-size allocations and assert()-ing them, so we can more easily get backtraces and debug problems, but we'll also allow -DNDEBUG people to live on the edge if they wish. We do not rely on errno when checking for OOM errors because some implementations of malloc do not set it, and malloc is commonly overridden by userspace wrappers. I've spent some time looking through the source and didn't find any obvious places where we would explicitly allocate 0 bytes, so we shouldn't trip any of those assertions. We also avoid allocating zero bytes because C libraries don't handle this consistently (some return NULL, some not); and it's dangerous either way. git-svn-id: https://svn.musicpd.org/mpd/trunk@4690 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* renamce cstrtok to buffer2array. please don't rename functions; especially ↵Warren Dukes2006-08-061-10/+18
| | | | | to names that look extremely std-lib-ish. also, don't use isspace, apparently it's local dependent and potentially consideres ' ' or '\t' not to be a space, or considers other characters to be a space. git-svn-id: https://svn.musicpd.org/mpd/trunk@4574 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* buffer2array: more unit testsEric Wong2006-08-051-0/+21
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4570 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* buffer2array: fix for trailing sub-quoted text inside a quoted contextEric Wong2006-08-051-2/+36
| | | | | | | | Also added a unit test to check for errors/bugs to make sure we don't have regressions. Bug found by Qball. git-svn-id: https://svn.musicpd.org/mpd/trunk@4569 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* buffer2array: oops, we forgot to take into account that \ is escaped, tooEric Wong2006-08-031-1/+2
| | | | | | Any escaped instances of \ must already be inside an already quoted string, though. git-svn-id: https://svn.musicpd.org/mpd/trunk@4539 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* replace buffer2array() with cstrtok() from mpd-keEric Wong2006-07-291-88/+32
| | | | | | | | This modifies the string in place, and does not allocate any memory from the heap. This is considerably smaller than the function it replaces, and will be instrumental in getting the commands/conf malloc reductions done. git-svn-id: https://svn.musicpd.org/mpd/trunk@4481 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add mpd-indent.shAvuton Olrich2006-07-201-40/+37
| | | | | | Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Change shank's email addressJ. Alexander Treuman2006-07-141-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Huge header update, update the copyright and addAvuton Olrich2006-07-131-1/+1
| | | | | the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* todo updateWarren Dukes2004-11-031-1/+0
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2499 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* add vim shiznit to end of all source filesWarren Dukes2004-04-141-0/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@750 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* cleanup reading from interface, when argArrayLength returned by buffer2arrayWarren Dukes2004-03-311-0/+8
| | | | | is 0, we weren't dealing with this well at all! git-svn-id: https://svn.musicpd.org/mpd/trunk@559 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* import from SF CVSWarren Dukes2004-02-231-0/+114
git-svn-id: https://svn.musicpd.org/mpd/trunk@1 09075e82-0dd4-0310-85a5-a0d7c8717e4f