aboutsummaryrefslogtreecommitdiff
path: root/dpip/dpip.c
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2011-07-15 09:56:19 -0400
committerJorge Arellano Cid <jcid@dillo.org>2011-07-15 09:56:19 -0400
commit5b311cb1ef29825290273ede14c7e90839b80985 (patch)
treec162cd6de7bc27fec12e3242c33022f07a7dd8c0 /dpip/dpip.c
parent5f46adec1f6ecab7b68f3a71efbd7abe60ca917e (diff)
Eliminated a pack of compiler warnings (gcc-4.6.1 amd64)
Diffstat (limited to 'dpip/dpip.c')
-rw-r--r--dpip/dpip.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/dpip/dpip.c b/dpip/dpip.c
index a5517784..170e4a88 100644
--- a/dpip/dpip.c
+++ b/dpip/dpip.c
@@ -214,11 +214,13 @@ int a_Dpip_check_auth(const char *auth_tag)
MSG_ERR("[a_Dpip_check_auth] empty file: %s\n", fname);
} else {
port = strtol(rcline, &tail, 10);
- for (i = 0; *tail && isxdigit(tail[i+1]); ++i)
- SharedSecret[i] = tail[i+1];
- SharedSecret[i] = 0;
- if (strcmp(msg, SharedSecret) == 0)
- ret = 1;
+ if (tail && port != 0) {
+ for (i = 0; *tail && isxdigit(tail[i+1]); ++i)
+ SharedSecret[i] = tail[i+1];
+ SharedSecret[i] = 0;
+ if (strcmp(msg, SharedSecret) == 0)
+ ret = 1;
+ }
}
if (In)
fclose(In);
@@ -376,7 +378,7 @@ int a_Dpip_dsh_write_str(Dsh *dsh, int flush, const char *str)
static void Dpip_dsh_read(Dsh *dsh, int blocking)
{
char buf[RBUF_SZ];
- int req_mode, old_flags = 0, st, ret = -3, nb = !blocking;
+ int req_mode, old_flags = 0, st, nb = !blocking;
dReturn_if (dsh->status == DPIP_ERROR || dsh->status == DPIP_EOF);
@@ -395,7 +397,6 @@ static void Dpip_dsh_read(Dsh *dsh, int blocking)
continue;
} else if (errno == EAGAIN) {
dsh->status = DPIP_EAGAIN;
- ret = -1;
break;
} else {
MSG_ERR("[Dpip_dsh_read] %s\n", dStrerror(errno));