Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!purdue!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.lang.c
Subject: Re: "do ... while ((NULL + 1) - 1);" -- valid C?
Message-ID: <10682@smoke.BRL.MIL>
Date: 8 Aug 89 21:09:26 GMT
References: <1043@levels.sait.edu.au>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 8

In article <1043@levels.sait.edu.au> ccdn@levels.sait.edu.au (DAVID NEWALL) writes:
-I've been told that this is not valid C because, in the case that there
-are no more fields (commas), strchr() returns NULL; and NULL + 1 is not
-valid.
-Comments, anyone?

You were told right.  You're not allowed to perform pointer arithmetic
involving null pointers.