On 2020-09-29 15:38, Michael Kerrisk (man-pages) wrote:
2.- Use sizeof() everywhere, and the macro for the initializer.
pros:
- It is valid as long as the buffer is an array.
cons:
- If the code gets into a function, and the buffer is then a pointer,
it will definitively produce a
> 2.- Use sizeof() everywhere, and the macro for the initializer.
>
> pros:
> - It is valid as long as the buffer is an array.
> cons:
> - If the code gets into a function, and the buffer is then a pointer,
>it will definitively produce a silent bug.
Sigh! I just did exactly the last
Hi Michael,
On 2020-09-24 13:38, Michael Kerrisk (man-pages) wrote:
> On 9/24/20 11:35 AM, Alejandro Colomar wrote:
>> Hi,
>>
>> On 2020-09-23 22:35, Michael Kerrisk (man-pages) wrote:
>>> On 9/15/20 12:03 PM, Stefan Puiu wrote:
Hi,
On Fri, Sep 11, 2020 at 6:28 PM Alejandro
On 9/24/20 11:35 AM, Alejandro Colomar wrote:
> Hi,
>
> On 2020-09-23 22:35, Michael Kerrisk (man-pages) wrote:
>> On 9/15/20 12:03 PM, Stefan Puiu wrote:
>>> Hi,
>>>
>>> On Fri, Sep 11, 2020 at 6:28 PM Alejandro Colomar
>>> wrote:
Hi Stefan,
On 2020-09-11 16:35, Stefan Puiu
Hi Michael
On 2020-09-24 12:04, Michael Kerrisk (man-pages) wrote:
Hi Alex,
[..]
I was reverting the 3 patches I introduced (they changed from solution 1
to solution 2), and also was grepping for already existing solution 2 in
the pages (it seems that solution 2 was a bit more extended than
Hi Alex,
[..]
> I was reverting the 3 patches I introduced (they changed from solution 1
> to solution 2), and also was grepping for already existing solution 2 in
> the pages (it seems that solution 2 was a bit more extended than
> solution 1).
Just so I can refresh my cache, which commits
Hi,
On 2020-09-23 22:35, Michael Kerrisk (man-pages) wrote:
On 9/15/20 12:03 PM, Stefan Puiu wrote:
Hi,
On Fri, Sep 11, 2020 at 6:28 PM Alejandro Colomar
wrote:
Hi Stefan,
On 2020-09-11 16:35, Stefan Puiu wrote:
> Hi,
>
> On Fri, Sep 11, 2020 at 12:15 AM Alejandro Colomar
>
On 9/15/20 12:03 PM, Stefan Puiu wrote:
> Hi,
>
> On Fri, Sep 11, 2020 at 6:28 PM Alejandro Colomar
> wrote:
>>
>> Hi Stefan,
>>
>> On 2020-09-11 16:35, Stefan Puiu wrote:
>> > Hi,
>> >
>> > On Fri, Sep 11, 2020 at 12:15 AM Alejandro Colomar
>> > wrote:
>> >>
>> >> Signed-off-by:
Hi,
On Fri, Sep 11, 2020 at 6:28 PM Alejandro Colomar
wrote:
>
> Hi Stefan,
>
> On 2020-09-11 16:35, Stefan Puiu wrote:
> > Hi,
> >
> > On Fri, Sep 11, 2020 at 12:15 AM Alejandro Colomar
> > wrote:
> >>
> >> Signed-off-by: Alejandro Colomar
> >> ---
> >> man3/getgrent_r.3 | 2 +-
>
Hi Walter,
On 9/14/20 11:24 AM, Walter Harms wrote:
> missunderstanding,
> i do not want to discuss sizeof() vs define
I did understand, that was point (3).
>
> in this example you do:
> #define BUFLEN 4096
> char buf[BUFLEN];
> getgrent_r(, buf, sizeof(buf), );
>
> so there is no real need
LEN
Von: Alejandro Colomar [colomar.6@gmail.com]
Gesendet: Freitag, 11. September 2020 21:17
An: Walter Harms; mtk.manpa...@gmail.com
Cc: linux-...@vger.kernel.org; linux-kernel@vger.kernel.org
Betreff: Re: AW: [PATCH 12/24] getgrent_r.3: Use sizeof() to get buffer size
(inst
Hi Walter,
On 2020-09-11 14:50, Walter Harms wrote:
BUFLEN should be remove completely or stay
jm2c
wh
Sorry that you weren't CC'd in the conversation we are having about it.
You can have a look at it here:
On 2020-09-11 17:28, Alejandro Colomar wrote:
Hi Stefan,
On 2020-09-11 16:35, Stefan Puiu wrote:
> Hi,
>
> On Fri, Sep 11, 2020 at 12:15 AM Alejandro Colomar
> wrote:
>>
>> Signed-off-by: Alejandro Colomar
>> ---
>> man3/getgrent_r.3 | 2 +-
>> 1 file changed, 1 insertion(+), 1
Hi,
On Fri, Sep 11, 2020 at 12:15 AM Alejandro Colomar
wrote:
>
> Signed-off-by: Alejandro Colomar
> ---
> man3/getgrent_r.3 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/man3/getgrent_r.3 b/man3/getgrent_r.3
> index 81d81a851..76deec370 100644
> ---
Hi Stefan,
On 2020-09-11 16:35, Stefan Puiu wrote:
> Hi,
>
> On Fri, Sep 11, 2020 at 12:15 AM Alejandro Colomar
> wrote:
>>
>> Signed-off-by: Alejandro Colomar
>> ---
>> man3/getgrent_r.3 | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/man3/getgrent_r.3
...@gmail.com
Cc: linux-...@vger.kernel.org; linux-kernel@vger.kernel.org; Alejandro Colomar
Betreff: [PATCH 12/24] getgrent_r.3: Use sizeof() to get buffer size (instead
of hardcoding macro name)
Signed-off-by: Alejandro Colomar
---
man3/getgrent_r.3 | 2 +-
1 file changed, 1 insertion(+), 1 deletion
On 9/10/20 11:13 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar
Thanks, Alex. Patch applied.
Cheers,
Michael
> ---
> man3/getgrent_r.3 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/man3/getgrent_r.3 b/man3/getgrent_r.3
> index 81d81a851..76deec370
Signed-off-by: Alejandro Colomar
---
man3/getgrent_r.3 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man3/getgrent_r.3 b/man3/getgrent_r.3
index 81d81a851..76deec370 100644
--- a/man3/getgrent_r.3
+++ b/man3/getgrent_r.3
@@ -186,7 +186,7 @@ main(void)
setgrent();
18 matches
Mail list logo