X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fserial.c;h=8bbd94c05534db9c16abdeeafef06b04292b8ac1;hp=1b587ca361c41ce4028923ea4de6452a2be1d272;hb=6e41c3b1f024d7944e5e8010a87933555c662474;hpb=029b489b237a8785c539f85d4840a49ba6743603 diff --git a/src/serial.c b/src/serial.c index 1b587ca3..8bbd94c0 100644 --- a/src/serial.c +++ b/src/serial.c @@ -59,7 +59,8 @@ static int serial_read(void) { while (fgets(buffer, sizeof(buffer), fh) != NULL) { derive_t rx = 0; derive_t tx = 0; - bool have_rx = 0, have_tx = 0; + bool have_rx = false; + bool have_tx = false; size_t len; char *fields[16]; @@ -87,10 +88,10 @@ static int serial_read(void) { if (strncmp(fields[i], "tx:", 3) == 0) { if (strtoderive(fields[i] + 3, &tx) == 0) - have_tx = 1; + have_tx = true; } else if (strncmp(fields[i], "rx:", 3) == 0) { if (strtoderive(fields[i] + 3, &rx) == 0) - have_rx = 1; + have_rx = true; } }