Re: [patch]rcs: comment typo

2014-11-30 Thread Otto Moerbeek
On Sat, Nov 29, 2014 at 05:14:08PM +0100, Fritjof Bornebusch wrote:

 On Sat, Nov 29, 2014 at 04:53:28PM +0100, Otto Moerbeek wrote:
  On Sat, Nov 29, 2014 at 02:22:25PM +0100, Fritjof Bornebusch wrote:
  
   Hi tech,
   
   it's NULL not NUL.
  
  You're touching a big controversy here. Many developers say that NUL is
  the right term when rferring to chars and not pointers,
 
 
 And what is the correct term when referring to '0'?
 Or means '\0' and '0' the same.

The first is ASCII NUL, the seconds ASCII zero.

-Otto

 
  
  -Otto
  
   
   fritjof
   
   
   Index: diff3.c
   ===
   RCS file: /cvs/src/usr.bin/rcs/diff3.c,v
   retrieving revision 1.33
   diff -u -p -r1.33 diff3.c
   --- diff3.c   4 Mar 2012 04:05:15 -   1.33
   +++ diff3.c   29 Nov 2014 13:15:51 -
   @@ -450,7 +450,7 @@ ed_patch_lines(struct rcs_lines *dlines,
 if (lp-l_len  2)
 continue;

   - /* NUL-terminate line buffer for strtol() safety. */
   + /* NULL-terminate line buffer for strtol() safety. */
 tmp = lp-l_line[lp-l_len - 1];
 lp-l_line[lp-l_len - 1] = '\0';

   Index: rcs.c
   ===
   RCS file: /cvs/src/usr.bin/rcs/rcs.c,v
   retrieving revision 1.81
   diff -u -p -r1.81 rcs.c
   --- rcs.c 10 Oct 2014 08:15:25 -  1.81
   +++ rcs.c 29 Nov 2014 13:16:40 -
   @@ -799,7 +799,7 @@ rcs_patch_lines(struct rcs_lines *dlines
 if (lp-l_len  2)
 errx(1, line too short, RCS patch seems broken);
 op = *(lp-l_line);
   - /* NUL-terminate line buffer for strtol() safety. */
   + /* NULL-terminate line buffer for strtol() safety. */
 tmp = lp-l_line[lp-l_len - 1];
 lp-l_line[lp-l_len - 1] = '\0';
 lineno = (int)strtol((lp-l_line + 1), ep, 10);
   @@ -1047,7 +1047,7 @@ rcs_delta_stats(struct rcs_delta *rdp, i
 errx(1,
 line too short, RCS patch seems broken);
 op = *(lp-l_line);
   - /* NUL-terminate line buffer for strtol() safety. */
   + /* NULL-terminate line buffer for strtol() safety. */
 tmp = lp-l_line[lp-l_len - 1];
 lp-l_line[lp-l_len - 1] = '\0';
 (void)strtol((lp-l_line + 1), ep, 10);
  
  




Re: [patch]rcs: comment typo

2014-11-29 Thread Claus Assmann
On Sat, Nov 29, 2014, Fritjof Bornebusch wrote:

 it's NULL not NUL.

Not in this case...

NULL: is a pointer (usually 0)
NUL: is a character ('\0')



Re: [patch]rcs: comment typo

2014-11-29 Thread Fritjof Bornebusch
On Sat, Nov 29, 2014 at 05:27:00AM -0800, Claus Assmann wrote:
 On Sat, Nov 29, 2014, Fritjof Bornebusch wrote:
 
  it's NULL not NUL.
 
 Not in this case...
 
 NULL: is a pointer (usually 0)
 NUL: is a character ('\0')
 

Ahh I see, thank you.



pgpMkIwf4S_cz.pgp
Description: PGP signature


Re: [patch]rcs: comment typo

2014-11-29 Thread Otto Moerbeek
On Sat, Nov 29, 2014 at 02:22:25PM +0100, Fritjof Bornebusch wrote:

 Hi tech,
 
 it's NULL not NUL.

You're touching a big controversy here. Many developers say that NUL is
the right term when rferring to chars and not pointers,

-Otto

 
 fritjof
 
 
 Index: diff3.c
 ===
 RCS file: /cvs/src/usr.bin/rcs/diff3.c,v
 retrieving revision 1.33
 diff -u -p -r1.33 diff3.c
 --- diff3.c   4 Mar 2012 04:05:15 -   1.33
 +++ diff3.c   29 Nov 2014 13:15:51 -
 @@ -450,7 +450,7 @@ ed_patch_lines(struct rcs_lines *dlines,
   if (lp-l_len  2)
   continue;
  
 - /* NUL-terminate line buffer for strtol() safety. */
 + /* NULL-terminate line buffer for strtol() safety. */
   tmp = lp-l_line[lp-l_len - 1];
   lp-l_line[lp-l_len - 1] = '\0';
  
 Index: rcs.c
 ===
 RCS file: /cvs/src/usr.bin/rcs/rcs.c,v
 retrieving revision 1.81
 diff -u -p -r1.81 rcs.c
 --- rcs.c 10 Oct 2014 08:15:25 -  1.81
 +++ rcs.c 29 Nov 2014 13:16:40 -
 @@ -799,7 +799,7 @@ rcs_patch_lines(struct rcs_lines *dlines
   if (lp-l_len  2)
   errx(1, line too short, RCS patch seems broken);
   op = *(lp-l_line);
 - /* NUL-terminate line buffer for strtol() safety. */
 + /* NULL-terminate line buffer for strtol() safety. */
   tmp = lp-l_line[lp-l_len - 1];
   lp-l_line[lp-l_len - 1] = '\0';
   lineno = (int)strtol((lp-l_line + 1), ep, 10);
 @@ -1047,7 +1047,7 @@ rcs_delta_stats(struct rcs_delta *rdp, i
   errx(1,
   line too short, RCS patch seems broken);
   op = *(lp-l_line);
 - /* NUL-terminate line buffer for strtol() safety. */
 + /* NULL-terminate line buffer for strtol() safety. */
   tmp = lp-l_line[lp-l_len - 1];
   lp-l_line[lp-l_len - 1] = '\0';
   (void)strtol((lp-l_line + 1), ep, 10);




Re: [patch]rcs: comment typo

2014-11-29 Thread Ingo Schwarze
Hi,

Otto Moerbeek wrote on Sat, Nov 29, 2014 at 04:53:28PM +0100:
 On Sat, Nov 29, 2014 at 02:22:25PM +0100, Fritjof Bornebusch wrote:

 Hi tech,
 
 it's NULL not NUL.

 You're touching a big controversy here. Many developers say that NUL is
 the right term when rferring to chars and not pointers,

Not only that.  For the system manuals, we have basically settled
on recommending

  .Dv NULL
for the NULL pointer, (void *)0
  NUL-terminated  \ without any markup
for talking about C strings, ... ending in '\0'

Yours,
  Ingo



Re: [patch]rcs: comment typo

2014-11-29 Thread Fritjof Bornebusch
On Sat, Nov 29, 2014 at 04:53:28PM +0100, Otto Moerbeek wrote:
 On Sat, Nov 29, 2014 at 02:22:25PM +0100, Fritjof Bornebusch wrote:
 
  Hi tech,
  
  it's NULL not NUL.
 
 You're touching a big controversy here. Many developers say that NUL is
 the right term when rferring to chars and not pointers,


And what is the correct term when referring to '0'?
Or means '\0' and '0' the same.

 
   -Otto
 
  
  fritjof
  
  
  Index: diff3.c
  ===
  RCS file: /cvs/src/usr.bin/rcs/diff3.c,v
  retrieving revision 1.33
  diff -u -p -r1.33 diff3.c
  --- diff3.c 4 Mar 2012 04:05:15 -   1.33
  +++ diff3.c 29 Nov 2014 13:15:51 -
  @@ -450,7 +450,7 @@ ed_patch_lines(struct rcs_lines *dlines,
  if (lp-l_len  2)
  continue;
   
  -   /* NUL-terminate line buffer for strtol() safety. */
  +   /* NULL-terminate line buffer for strtol() safety. */
  tmp = lp-l_line[lp-l_len - 1];
  lp-l_line[lp-l_len - 1] = '\0';
   
  Index: rcs.c
  ===
  RCS file: /cvs/src/usr.bin/rcs/rcs.c,v
  retrieving revision 1.81
  diff -u -p -r1.81 rcs.c
  --- rcs.c   10 Oct 2014 08:15:25 -  1.81
  +++ rcs.c   29 Nov 2014 13:16:40 -
  @@ -799,7 +799,7 @@ rcs_patch_lines(struct rcs_lines *dlines
  if (lp-l_len  2)
  errx(1, line too short, RCS patch seems broken);
  op = *(lp-l_line);
  -   /* NUL-terminate line buffer for strtol() safety. */
  +   /* NULL-terminate line buffer for strtol() safety. */
  tmp = lp-l_line[lp-l_len - 1];
  lp-l_line[lp-l_len - 1] = '\0';
  lineno = (int)strtol((lp-l_line + 1), ep, 10);
  @@ -1047,7 +1047,7 @@ rcs_delta_stats(struct rcs_delta *rdp, i
  errx(1,
  line too short, RCS patch seems broken);
  op = *(lp-l_line);
  -   /* NUL-terminate line buffer for strtol() safety. */
  +   /* NULL-terminate line buffer for strtol() safety. */
  tmp = lp-l_line[lp-l_len - 1];
  lp-l_line[lp-l_len - 1] = '\0';
  (void)strtol((lp-l_line + 1), ep, 10);
 
 


pgpxlyH4t3nOW.pgp
Description: PGP signature