summaryrefslogtreecommitdiff
path: root/sftp-server.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-06-17 12:59:34 +1000
committerDamien Miller <djm@mindrot.org>2005-06-17 12:59:34 +1000
commiteccb9de72aa29da5a3fad87a4287b32438689c1f (patch)
tree9b8ef20a7e454b984e0ad67b54b2bdc5577aa2fa /sftp-server.c
parent677257fe07dd2b9a58817e1d42fc2c25bb618a4d (diff)
- djm@cvs.openbsd.org 2005/06/17 02:44:33
[auth-rsa.c auth.c auth1.c auth2-chall.c auth2-gss.c authfd.c authfile.c] [bufaux.c canohost.c channels.c cipher.c clientloop.c dns.c gss-serv.c] [kex.c kex.h key.c mac.c match.c misc.c packet.c packet.h scp.c] [servconf.c session.c session.h sftp-client.c sftp-server.c sftp.c] [ssh-keyscan.c ssh-rsa.c sshconnect.c sshconnect1.c sshconnect2.c sshd.c] make this -Wsign-compare clean; ok avsm@ markus@ NB. auth1.c changes not committed yet (conflicts with uncommitted sync) NB2. more work may be needed to make portable Wsign-compare clean
Diffstat (limited to 'sftp-server.c')
-rw-r--r--sftp-server.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sftp-server.c b/sftp-server.c
index e82280057..6870e7732 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -14,7 +14,7 @@
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */ 15 */
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: sftp-server.c,v 1.47 2004/06/25 05:38:48 dtucker Exp $"); 17RCSID("$OpenBSD: sftp-server.c,v 1.48 2005/06/17 02:44:33 djm Exp $");
18 18
19#include "buffer.h" 19#include "buffer.h"
20#include "bufaux.h" 20#include "bufaux.h"
@@ -130,7 +130,7 @@ Handle handles[100];
130static void 130static void
131handle_init(void) 131handle_init(void)
132{ 132{
133 int i; 133 u_int i;
134 134
135 for (i = 0; i < sizeof(handles)/sizeof(Handle); i++) 135 for (i = 0; i < sizeof(handles)/sizeof(Handle); i++)
136 handles[i].use = HANDLE_UNUSED; 136 handles[i].use = HANDLE_UNUSED;
@@ -139,7 +139,7 @@ handle_init(void)
139static int 139static int
140handle_new(int use, const char *name, int fd, DIR *dirp) 140handle_new(int use, const char *name, int fd, DIR *dirp)
141{ 141{
142 int i; 142 u_int i;
143 143
144 for (i = 0; i < sizeof(handles)/sizeof(Handle); i++) { 144 for (i = 0; i < sizeof(handles)/sizeof(Handle); i++) {
145 if (handles[i].use == HANDLE_UNUSED) { 145 if (handles[i].use == HANDLE_UNUSED) {
@@ -156,7 +156,7 @@ handle_new(int use, const char *name, int fd, DIR *dirp)
156static int 156static int
157handle_is_ok(int i, int type) 157handle_is_ok(int i, int type)
158{ 158{
159 return i >= 0 && i < sizeof(handles)/sizeof(Handle) && 159 return i >= 0 && (u_int)i < sizeof(handles)/sizeof(Handle) &&
160 handles[i].use == type; 160 handles[i].use == type;
161} 161}
162 162
@@ -477,10 +477,10 @@ process_write(void)
477 } else { 477 } else {
478/* XXX ATOMICIO ? */ 478/* XXX ATOMICIO ? */
479 ret = write(fd, data, len); 479 ret = write(fd, data, len);
480 if (ret == -1) { 480 if (ret < 0) {
481 error("process_write: write failed"); 481 error("process_write: write failed");
482 status = errno_to_portable(errno); 482 status = errno_to_portable(errno);
483 } else if (ret == len) { 483 } else if ((size_t)ret == len) {
484 status = SSH2_FX_OK; 484 status = SSH2_FX_OK;
485 } else { 485 } else {
486 logit("nothing at all written"); 486 logit("nothing at all written");