lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lynx-dev] Display of some multi-line links is cut off in the middle


From: Thorsten Glaser
Subject: Re: [Lynx-dev] Display of some multi-line links is cut off in the middle
Date: Fri, 31 Dec 2021 03:34:11 +0000 (UTC)

KIHARA Hideto dixit:

>Reverting following change solves the problem.

>-          strcat(linedata, p);
>+          for (i = 0; (linedata[i] = p[i]) != '\0'; ++i) ;

The lower line is a strcpy inlined, not a strcat, so probably a
bogus refactor…

(that being said, I’d prefer if new code used either strlcat, if
the lengths are unknown/unchecked (but linedata is NUL-terminated
before the call) or memcpy (if the lengths are known, e.g. because
the target was allocated at the right size))

Meow,
//mirabilos
-- 
15:41⎜<Lo-lan-do:#fusionforge> Somebody write a testsuite for helloworld :-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]