From 2c0adb475a10db81f76266e8bd1a860b8dc0cc3d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 27 May 2011 10:29:47 -0700 Subject: tools: Fix unused variable warnings for WISPr client --- tools/wispr.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/wispr.c b/tools/wispr.c index a0002ba3..0792f5b1 100644 --- a/tools/wispr.c +++ b/tools/wispr.c @@ -307,10 +307,14 @@ struct user_input_data { static void user_callback(struct user_input_data *data) { char *value; - int len; - if (data->hidden == TRUE) + if (data->hidden == TRUE) { + ssize_t len; + len = write(data->fd, "\n", 1); + if (len < 0) + return; + } tcsetattr(data->fd, TCSADRAIN, &data->saved_termios); @@ -358,7 +362,7 @@ static gboolean user_input(const char *label, gboolean hidden, struct termios new_termios; GIOChannel *channel; guint watch; - int len; + ssize_t len; data = g_try_new0(struct user_input_data, 1); if (data == NULL) @@ -398,7 +402,12 @@ static gboolean user_input(const char *label, gboolean hidden, goto error; len = write(data->fd, label, strlen(label)); + if (len < 0) + goto error; + len = write(data->fd, ": ", 2); + if (len < 0) + goto error; return TRUE; -- cgit v1.2.3