Deutsch English Français Italiano |
<vsjujs$21log$1@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: A question regarding C string functions Date: Wed, 2 Apr 2025 18:11:08 -0000 (UTC) Organization: A noiseless patient Spider Lines: 18 Message-ID: <vsjujs$21log$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 02 Apr 2025 20:11:09 +0200 (CEST) Injection-Info: dont-email.me; posting-host="dcacd71ee3984a7bbaade915e5fee771"; logging-data="2152208"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Aj3/3nU07nPIcGELW5TTFq0cTCC3fkO0=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:pJais2zyP2CBOXUsRtw1ROYs86g= Bytes: 1467 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"