:: Re: [DNG] C string handling
Etusivu
Poista viesti
Vastaa
Lähettäjä: Rainer Weikusat
Päiväys:  
Vastaanottaja: dng
Aihe: Re: [DNG] C string handling
"tilt!" <tilt@???> writes:
> On 08/22/2015 04:40 PM, Rainer Weikusat wrote:
>> Roger Leigh <rleigh@???> writes:
>>> On 20/08/2015 11:27, Rainer Weikusat wrote:
>>>> Roger Leigh <rleigh@???> writes:
>>>>> On 19/08/2015 17:39, Rainer Weikusat wrote:
>>
>> [...]
>>
>>>>>>     p_len = strlen(IFACES_PATH);
>>>>>>     e_len = strlen(essid);
>>>>>>     path = alloca(p_len + e_len + 2);

>>>>>>     
>>>>>>     strcpy(path, IFACES_PATH);
>>>>>>     path[p_len] = '/';
>>>>>>     strcpy(path + p_len + 1, essid);

>>
>> [...]
>>
>
> I am fully aware of the C string problem.


There is not such thing as a "C string problem": The C standard library
supplies a set of string handling functions working in a certain
way. This way has some advantages but also, some disadvantages.

[...]

> Believe me, I already rewrote specifically this section of
> the code, so don't bother too much.


Ah ... and why precisely are you telling me this? Some guy posted some
code. I posted some comments and related code intended to be helpful in
this context. Some discussion also resulted from that. You seem to be
convinced that this wouldn't be worth the effort compared with the much
larger effort of "rewriting the code" (you assert in a way which seems
rather condescending to me). I could comment on this social procedure
but I won't because I'm convinced that this "talking about people" never
leads to anything good. But should Edward (or you) post more code, I
will probably look through that, at least cursory, and post more
comments (and probably more code because the comments alone are not
useful) because this (code) happens to be something I'm interested in.