Re: [PATCH 1/5] service: Add function to remove empty strings

2015-07-15 Thread Tomasz Bursztyka
Hi Jaakko, Make the whole change it one loop. No need to check if there is, empty strings, at first. It's greedy and, if there 1+ empty lines, you will anyway loop all over again. Tomasz This helper function takes in a heap-allocated buffer of heap-allocated strings. If no strings should

Re: [PATCH 1/5] service: Add function to remove empty strings

2015-07-15 Thread Slava Monich
Hi Jaakko, On ke, 2015-07-15 at 11:35 +0300, Jaakko Hannikainen wrote: This helper function takes in a heap-allocated buffer of heap-allocated strings. If no strings should be removed, return the buffer. Else, free all empty strings, place nonempty strings to a new container and return it,

[PATCH 1/5] service: Add function to remove empty strings

2015-07-15 Thread Jaakko Hannikainen
This helper function takes in a heap-allocated buffer of heap-allocated strings. If no strings should be removed, return the buffer. Else, free all empty strings, place nonempty strings to a new container and return it, freeing the old container. --- src/service.c | 32

Re: [PATCH 1/5] service: Add function to remove empty strings

2015-07-15 Thread Jukka Rissanen
Hi Jaakko, On ke, 2015-07-15 at 11:35 +0300, Jaakko Hannikainen wrote: This helper function takes in a heap-allocated buffer of heap-allocated strings. If no strings should be removed, return the buffer. Else, free all empty strings, place nonempty strings to a new container and return it,