Re: [PATCH v3 2/2] xgethostname: handle long hostnames

2017-04-19 Thread René Scharfe
>; git@vger.kernel.org; >> l@web.de >> Subject: Re: [PATCH v3 2/2] xgethostname: handle long hostnames >> >> Jonathan Nieder <jrnie...@gmail.com> writes: >> >>> Hi, >>> >>> David Turner wrote: >>> >>&

RE: [PATCH v3 2/2] xgethostname: handle long hostnames

2017-04-19 Thread David Turner
> -Original Message- > From: Junio C Hamano [mailto:gits...@pobox.com] > Sent: Tuesday, April 18, 2017 10:51 PM > To: Jonathan Nieder <jrnie...@gmail.com> > Cc: David Turner <david.tur...@twosigma.com>; git@vger.kernel.org; > l....@web.de > Subject: Re: [P

Re: [PATCH v3 2/2] xgethostname: handle long hostnames

2017-04-18 Thread Junio C Hamano
Jonathan Nieder writes: > Hi, > > David Turner wrote: > >> If the full hostname doesn't fit in the buffer supplied to >> gethostname, POSIX does not specify whether the buffer will be >> null-terminated, so to be safe, we should do it ourselves. Introduce >> new function,

Re: [PATCH v3 2/2] xgethostname: handle long hostnames

2017-04-18 Thread Junio C Hamano
David Turner writes: > If the full hostname doesn't fit in the buffer supplied to > gethostname, POSIX does not specify whether the buffer will be > null-terminated, so to be safe, we should do it ourselves. Introduce The name of the character whose ASCII value is '\0' is

Re: [PATCH v3 2/2] xgethostname: handle long hostnames

2017-04-18 Thread Jonathan Nieder
Hi, David Turner wrote: > If the full hostname doesn't fit in the buffer supplied to > gethostname, POSIX does not specify whether the buffer will be > null-terminated, so to be safe, we should do it ourselves. Introduce > new function, xgethostname, which ensures that there is always a \0 > at