Deutsch   English   Français   Italiano  
<vsk035$21log$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Lew Pitcher <lew.pitcher@digitalfreehold.ca>
Newsgroups: comp.lang.c
Subject: Re: A question regarding C string functions
Date: Wed, 2 Apr 2025 18:36:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <vsk035$21log$2@dont-email.me>
References: <vsjujs$21log$1@dont-email.me> <20250402112547.50@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 02 Apr 2025 20:36:21 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="dcacd71ee3984a7bbaade915e5fee771";
	logging-data="2152208"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19utAG0T+9C+S8VUFrDDvU5UZku4TOx91o="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
 git://git.gnome.org/pan2)
Cancel-Lock: sha1:3qyw7guw2QQG6HFviWloXfGEpUI=
Bytes: 2148

On Wed, 02 Apr 2025 18:33:17 +0000, Kaz Kylheku wrote:

> On 2025-04-02, Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>> I cannot find any definitive statement in my copies of the various
>> C language standards that addresses the behaviour of the C string
>> functions when given a NULL pointer.
> 
> Let us start with ISO C 90.
> 
>   7.1.7 Use of library functions
>  
>   Each of the following statements applies unless explicitly stated
>   otherwise in the detailed descriptions that follow. If an argument to
>   a function has an invalid value (such as a value outside the domain of
>   the function. or a pointer outside the address space of the program.
>   or a null pointer), the behavior is undefined. 
>   ^^^^^^^^^^^^^^^^^

Thanks, Kaz

I knew that I had seen such a statement in the standards before, but
for the life of me, I couldn't find it today.

That settles my quandry; the code I'm looking at has got to change

[snip]
> It gets more verbose and indented, but the null treatment is
> consistently there.


Thanks again

-- 
Lew Pitcher
"In Skills We Trust"