]> sigrok.org Git - libsigrok.git/commitdiff
sr: session: Use realloc to resize source array
authorLars-Peter Clausen <redacted>
Sat, 30 Jun 2012 18:54:42 +0000 (20:54 +0200)
committerUwe Hermann <redacted>
Wed, 4 Jul 2012 23:41:00 +0000 (01:41 +0200)
Use realloc to resize the source array when adding or removing a source. This
makes the code a bit smaller. In the remove function we now check whether the fd
is valid before doing anything else and if it is not simply do nothing. If it is
valid use memove to move the elements following the source one element down in
the array. Only after that has been done the array is re-allocated.

Signed-off-by: Lars-Peter Clausen <redacted>

No differences found