[Nut-upsdev] drivers/bcmxcp.c portability issue

Charles Lepple clepple at gmail.com
Wed Dec 16 02:06:50 UTC 2009

On Dec 15, 2009, at 8:40 PM, Tim Rice wrote:

> On Tue, 15 Dec 2009, Arjen de Korte wrote:
>> Citeren Kjell Claesson <kjell.claesson at epost.tidanet.se>:
>>>> Although gcc can handle it, it's not portable C code.
>>>> What size should the answer array be?
>>> It depends on the ups.
>> If the size of the answer isn't known at compile time, you should  
>> either
>> allocate it dynamically with malloc() or calloc() (at runtime) or  
>> hardcode the
>> size so big that any reply should fit in it.
> This may be the least intrusive way to fix it.


Looks good to me, but for some reason, your patches seem to be missing  
a leading space (which makes them not apply automatically. I am  
attaching a patch that is functionally equivalent to yours, and if  
nobody objects, that's what I'll commit.

- Charles
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bcmxcp-buffer.patch
Type: application/octet-stream
Size: 646 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20091215/65834b28/attachment-0001.obj>
-------------- next part --------------

More information about the Nut-upsdev mailing list