]> sigrok.org Git - libsigrok.git/commit
device: rephrase sizeof() calls for reduced redundancy, use malloc0
authorGerhard Sittig <redacted>
Mon, 2 Oct 2017 15:26:52 +0000 (16:26 +0100)
committerGerhard Sittig <redacted>
Sun, 28 Apr 2019 15:41:12 +0000 (17:41 +0200)
commite47a9562e990c44cd6915cde8bab270ff41ec9d7
tree908de9d4dfd8a9aea212d9b766cdbaa97e41dbda
parent7d0f52f7e5cb16d204490ca4006983237bf3df7d
device: rephrase sizeof() calls for reduced redundancy, use malloc0

Just allocate the memory needed to hold the very variable's size. No
need to duplicate the variable's type. Reduces redundancy and increases
robustness during maintenance.

Use g_malloc0() in sr_serial_new() to make sure all of the structure is
initialized.
src/device.c
src/serial.c