A question regarding C string functions

Liste des GroupesRevenir à cl c 
Sujet : A question regarding C string functions
De : lew.pitcher (at) *nospam* digitalfreehold.ca (Lew Pitcher)
Groupes : comp.lang.c
Date : 02. Apr 2025, 19:11:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsjujs$21log$1@dont-email.me>
User-Agent : Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
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.

Specifically, what does the C standard dictate about the behaviour of
  strrchr(NULL,'/')
but the question could apply to any of the string functions
(strlen(NULL), etc.)

My gut impression is that
  strrchr(NULL,'/'), etc
invoke undefined behaviour, and should be avoided.

Can anyone comment?

--
Lew Pitcher
"In Skills We Trust"

Date Sujet#  Auteur
2 Apr 25 * A question regarding C string functions8Lew Pitcher
2 Apr 25 +* Re: A question regarding C string functions3Kaz Kylheku
2 Apr 25 i+- Re: A question regarding C string functions1Lew Pitcher
3 Apr 25 i`- Re: A question regarding C string functions1David Brown
3 Apr 25 +* Re: A question regarding C string functions3Tim Rentsch
3 Apr 25 i+- Re: A question regarding C string functions1Lew Pitcher
3 Apr 25 i`- Re: A question regarding C string functions1Ethan Carter
3 Apr 25 `- Re: A question regarding C string functions1James Kuyper

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal