From: Miklos S. <mi...@sz...> - 2011-12-20 14:46:11
|
Mike Kelly <mi...@pa...> writes: > sshfs.c: In function 'sshfs_read_end': > sshfs.c:2383: warning: 'serr' is used uninitialized in this function > --- > sshfs.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/sshfs.c b/sshfs.c > index 323ab6c..374f905 100644 > --- a/sshfs.c > +++ b/sshfs.c > @@ -2380,7 +2380,7 @@ static void sshfs_read_end(struct request *req) > rreq->res = -EIO; > > if (req->reply_type == SSH_FXP_STATUS) { > - uint32_t serr; > + uint32_t serr = 0; That just hides the bug. Warnings are not always bogus ;) This patch should actually fix it: --- sshfs.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sshfs.c b/sshfs.c index 323ab6c..22c1e2d 100644 --- a/sshfs.c +++ b/sshfs.c @@ -2384,8 +2384,8 @@ static void sshfs_read_end(struct request *req) if (buf_get_uint32(&req->reply, &serr) != -1) { if (serr == SSH_FX_EOF) rreq->res = 0; - } else { - rreq->res = -sftp_error_to_errno(serr); + else + rreq->res = -sftp_error_to_errno(serr); } } else if (req->reply_type == SSH_FXP_DATA) { uint32_t retsize; -- 1.7.7 |