summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-02-21 14:34:53 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-02-21 14:34:53 +0100
commite81b440f6878605edd19ed62441648ac71260881 (patch)
treebec78543f4a89096ac22e850dbb814a3f75d119a /client
parent9e43ccf07b96597ef098955a07383d826938cd2d (diff)
downloadbird-e81b440f6878605edd19ed62441648ac71260881.tar
bird-e81b440f6878605edd19ed62441648ac71260881.zip
Fix configure to enable warnings and fix most of them.
Diffstat (limited to 'client')
-rw-r--r--client/client.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/client/client.c b/client/client.c
index 8f514f6..9acabf2 100644
--- a/client/client.c
+++ b/client/client.c
@@ -311,10 +311,12 @@ update_state(void)
}
if (nstate == STATE_PROMPT)
- if (input_initialized)
- input_reveal();
- else
- input_init();
+ {
+ if (input_initialized)
+ input_reveal();
+ else
+ input_init();
+ }
if (nstate != STATE_PROMPT)
input_hide();
@@ -372,6 +374,8 @@ server_connect(void)
die("fcntl: %m");
}
+#define PRINTF(LEN, PARGS...) do { if (!skip_input) len = printf(PARGS); } while(0)
+
static void
server_got_reply(char *x)
{
@@ -379,15 +383,15 @@ server_got_reply(char *x)
int len = 0;
if (*x == '+') /* Async reply */
- skip_input || (len = printf(">>> %s\n", x+1));
+ PRINTF(len, ">>> %s\n", x+1);
else if (x[0] == ' ') /* Continuation */
- skip_input || (len = printf("%s%s\n", verbose ? " " : "", x+1));
+ PRINTF(len, "%s%s\n", verbose ? " " : "", x+1);
else if (strlen(x) > 4 &&
sscanf(x, "%d", &code) == 1 && code >= 0 && code < 10000 &&
(x[4] == ' ' || x[4] == '-'))
{
if (code)
- skip_input || (len = printf("%s\n", verbose ? x : x+5));
+ PRINTF(len, "%s\n", verbose ? x : x+5);
if (x[4] == ' ')
{
nstate = STATE_PROMPT;
@@ -396,7 +400,7 @@ server_got_reply(char *x)
}
}
else
- skip_input || (len = printf("??? <%s>\n", x));
+ PRINTF(len, "??? <%s>\n", x);
if (skip_input)
return;