summaryrefslogtreecommitdiffstats
path: root/tailburst.c
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-02-12 10:13:44 +0100
committerDominique Martinet <asmadeus@codewreck.org>2017-02-12 10:13:44 +0100
commitcb500e603daa4bbd11762fc96c51319d3bfd9255 (patch)
tree70de0cf6149871a057fbdddf9f57463e246ed33b /tailburst.c
parentec9f67cff5eac2e3a15d997ccb67b459f77f5427 (diff)
add -Wall
Diffstat (limited to 'tailburst.c')
-rw-r--r--tailburst.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tailburst.c b/tailburst.c
index 2aaa5a5..634dc92 100644
--- a/tailburst.c
+++ b/tailburst.c
@@ -40,7 +40,7 @@ ssize_t fdgetline(int fd, struct getline_states *line) {
line->cur = line->base;
/* Do we already have a full line in buffer? */
- if (str = strchr(line->cur, '\n')) {
+ if ((str = strchr(line->cur, '\n'))) {
line->next = str+1;
str[0] = '\0';
pr_debug("next already buffered, %p %p: %s\n", str, line->cur, line->cur);
@@ -56,11 +56,11 @@ ssize_t fdgetline(int fd, struct getline_states *line) {
}
while ((nread = read(fd, line->base + line->read, line->size - line->read)) > 0 ) {
- pr_debug("read %d\n", nread);
+ pr_debug("read %zd\n", nread);
line->read += nread;
/* Check if we have a full line now */
- if (str = strchr(line->base, '\n')) {
+ if ((str = strchr(line->base, '\n'))) {
line->next = str+1;
str[0] = '\0';
pr_debug("found stuff, %p %p %p: %s\n", str, line->base, line->cur, line->cur);
@@ -73,7 +73,7 @@ ssize_t fdgetline(int fd, struct getline_states *line) {
if (line->base == NULL)
return -ENOMEM;
}
- pr_debug("got here? %d %d\n", nread, errno);
+ pr_debug("got here? %zd %d\n", nread, errno);
line->next = line->cur;
if (errno)
@@ -85,8 +85,7 @@ ssize_t fdgetline(int fd, struct getline_states *line) {
int main(int argc, char **argv)
{
- int flags, fd = 0, rc;
- size_t len = 0;
+ int flags, fd = 0;
ssize_t nread;
struct pollfd pollfd;
struct getline_states line = { 0 };