>
>>> + memmove (*line, l, len);
>>> + (*line)[len - 1] = '\0';
>>> + *line_len = --len;
>>
>> Generally, I would prefer to use memcpy,
>> if it is clear that the memory does not overlap.
>
> I don't mind. I'll change that in my local copy. Thanks.
>
>> You copy one char too much and set it to zero?
>
> It's not one char too much. That char is the terminal '\n' in most
> cases.
>

and what is it if there is no terminal '\n' ?

>> Using -- on a value that goes out of scope looks
>> awkward IMHO.
>
> I don't understand this sentence. What do you mean by "Using -- on a
> value that goes out of scope"?
>

I meant the operator --  in  *line_len = --len;

Maybe, You could also avoid the copying completely, if you just hand out
a pointer to the line buffer as const char*, and use the length instead of the
nul-char as end delimiter ?

Bernd.                                    

Reply via email to