delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2007/11/07/22:24:52

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Date: Wed, 7 Nov 2007 22:24:49 -0500
Message-Id: <200711080324.lA83Onqj027967@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp-workers AT delorie DOT com
In-reply-to: <200711062228.27687.juan.guerrero@gmx.de> (message from Juan
Manuel Guerrero on Tue, 6 Nov 2007 22:28:27 +0100)
Subject: Re: About the syntax of the change file for djtar
References: <200711061825 DOT 42739 DOT juan DOT guerrero AT gmx DOT de> <200711070036 DOT lA70aAWs017106 AT envy DOT delorie DOT com> <200711062228 DOT 27687 DOT juan DOT guerrero AT gmx DOT de>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

The problem is, you can't use fgets if you allow NUL as a character,
because you can't check the length of such a string with strlen().  If
you want to write a NUL-safe fgets variant, that would be fine.  It
would need to return the number of bytes read in, and we'd have to use
memrchr() (more likely, write our own) instead of strrchr().

We can choose a non-NUL byte if that would help; perhaps 0x7f or 0x01.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019