Csound Csound-dev Csound-tekno Search About

[Csnd-dev] OSCinit bug?

Date2016-10-17 20:37
Fromjpff
Subject[Csnd-dev] OSCinit bug?
Is this a bug?  In OSC.c function osc_listener_init there is code to
realloc the vector for remembering ports.  I think this is wrong if
the user tries to listen on more that 1 port and initialises them in
decreasing order.

    n = pp->nPorts;
    ports = (OSC_PORT*) csound->ReAlloc(csound, pp->ports,
                                        sizeof(OSC_PORT) * (n + 1));

Surely it should only realloc if n is bigger than the current length
of ports.

I am looking at bug #695 and wondering if one could close the port
before opening  it.

Date2016-10-17 21:03
Fromjpff
SubjectRe: [Csnd-dev] OSCinit bug?
Or perhaps I am wrong......  o far failing to understand the code (which I 
tink I wrote).  Must be getting late

On Mon, 17 Oct 2016, jpff wrote:

> Is this a bug?  In OSC.c function osc_listener_init there is code to
> realloc the vector for remembering ports.  I think this is wrong if
> the user tries to listen on more that 1 port and initialises them in
> decreasing order.
>
>    n = pp->nPorts;
>    ports = (OSC_PORT*) csound->ReAlloc(csound, pp->ports,
>                                        sizeof(OSC_PORT) * (n + 1));
>
> Surely it should only realloc if n is bigger than the current length
> of ports.
>
> I am looking at bug #695 and wondering if one could close the port
> before opening  it.
>
> ==John ffitch