X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fserial.c;h=8bbd94c05534db9c16abdeeafef06b04292b8ac1;hp=2b77db655b2cec0d88772949c9ba9d72b80951cf;hb=06a86a60a7dabc685bdbd81ce3d36ea5f7e2c2d4;hpb=084761bb8a360ac0f9e21ad43c82312676cc4a37 diff --git a/src/serial.c b/src/serial.c index 2b77db65..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; } }