Re: NULL vs NUL (changeset: 6873:65f180f2904f)

2016-11-25 Thread Derek Martin
On Tue, Nov 22, 2016 at 03:47:37AM +0100, Vincent Lefevre wrote:
> NUL means the ASCII or EBCDIC character \0 (the special characters
> in US-ASCII and EBCDIC typically have names with at most 3 letters,
> hence this abbreviation).

I think technically "abbreviation" is not even correct--it is the
symbolic representation of the character.  By custom and convention,
it is mainly used to literally represent occurances of the normally
unprintable ASCII null character in a text document, and where
possible is usually represented as a single trigraph with the letters
drawn in a single character cell, diagonally from top to bottom, left
to right (i.e.'␀'), intstead of the string "NUL".  It is typically
only written out as a string of characters when the former is not
possible for the source document (or the author is unable or unwilling
to figure out how to produce the trigraph :-)), such as ASCII text
documents.

In written English sentences, including code comments, you should
always instead write "null" (and in this case "null-terminated").

> In C, the byte 0 is called the "null character". NUL is definitely
> wrong in this context, as C may be based on a character set other
> than ASCII or EBCDIC, while the null character is charset independent.

Well, in principle, maybe (though I'm not even sure of that)... In
practice, there's no such character set, and unlikely ever will be.
The word "null" MEANS zero (or "having no value, nothing," and similar
related ideas).  It's zero everywhere.

> > > +  /* Note that X509_NAME_oneline will NUL-terminate buf, even when it
> 
> Should be:
> 
>   /* Note that X509_NAME_oneline will null-terminate buf, even when it

Yes.

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



pgpYauoXSiLKu.pgp
Description: PGP signature


Re: NULL vs NUL (changeset: 6873:65f180f2904f)

2016-11-21 Thread Kevin J. McCarthy
On Tue, Nov 22, 2016 at 03:47:37AM +0100, Vincent Lefevre wrote:
> In C, the byte 0 is called the "null character". NUL is definitely
> wrong in this context, as C may be based on a character set other
> than ASCII or EBCDIC, while the null character is charset independent.

Thanks Claus and Vincent, for the interesting discussion and the
commit-fix.  Something was telling me NULL was incorrect, when I typed
it.  Now I know what to use in the future!

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


NULL vs NUL (changeset: 6873:65f180f2904f)

2016-11-21 Thread Claus Assmann
On Mon, Nov 21, 2016, Brendan Cully wrote:
> changeset: 6873:65f180f2904f

> X509_NAME_oneline() always NULL-terminates the string, even when it

Isn't the common terminology:
NULL: NULL pointer
NUL: '\0'
?

> +  /* Note that X509_NAME_online will NULL-terminate buf, even when it
  ^e   ^
->

> +  /* Note that X509_NAME_oneline will NUL-terminate buf, even when it