TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: R.WIESER
from: THE NATURAL PHILOSOPHER
date: 2019-02-24 17:43:00
subject: Re: C is not a low level

On 24/02/2019 16:21, R.Wieser wrote:
> (too many newsgroups, had to snip a few)
>
> Richard,
>
>> Indeed, although I'd cache the length rather than make the compiler find
>
> :-) And thats exactly the kind of thing you should try to avoid.
>
> In this simple example it will work, but you're /still/ trying to write a
> full buffers worth - when you should leave that last character untouched,
> just in case.
>
> Ofcourse, I would rather check the length of the to-be-copied string and
> throw an error when it doesn't fit, but maybe thats just me ... (Just
> imagine you're copying some kind of commandline string, with a few argument
> switches at the end).
>
That is an option if you know roughly what SHOULD be there.

> Regards,
> Rudy Wieser
>
>
>
>


--
"The most difficult subjects can be explained to the most slow witted
man if he has not formed any idea of them already; but the simplest
thing cannot be made clear to the most intelligent man if he is firmly
persuaded that he knows already, without a shadow of doubt, what is laid
before him."

    - Leo Tolstoy

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.