]> andersk Git - openssh.git/blobdiff - sftp-server.c
- dtucker@cvs.openbsd.org 2005/07/08 09:26:18
[openssh.git] / sftp-server.c
index 1ff4750ea64c442c06d966ee1f68dff64aeaeb81..6870e7732039ec94661aea29fd3f703da0a31f9c 100644 (file)
@@ -14,7 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: sftp-server.c,v 1.47 2004/06/25 05:38:48 dtucker Exp $");
+RCSID("$OpenBSD: sftp-server.c,v 1.48 2005/06/17 02:44:33 djm Exp $");
 
 #include "buffer.h"
 #include "bufaux.h"
@@ -31,11 +31,7 @@ RCSID("$OpenBSD: sftp-server.c,v 1.47 2004/06/25 05:38:48 dtucker Exp $");
 #define get_string(lenp)               buffer_get_string(&iqueue, lenp);
 #define TRACE                          debug
 
-#ifdef HAVE___PROGNAME
 extern char *__progname;
-#else
-char *__progname;
-#endif
 
 /* input and output queue */
 Buffer iqueue;
@@ -134,7 +130,7 @@ Handle      handles[100];
 static void
 handle_init(void)
 {
-       int i;
+       u_int i;
 
        for (i = 0; i < sizeof(handles)/sizeof(Handle); i++)
                handles[i].use = HANDLE_UNUSED;
@@ -143,7 +139,7 @@ handle_init(void)
 static int
 handle_new(int use, const char *name, int fd, DIR *dirp)
 {
-       int i;
+       u_int i;
 
        for (i = 0; i < sizeof(handles)/sizeof(Handle); i++) {
                if (handles[i].use == HANDLE_UNUSED) {
@@ -160,7 +156,7 @@ handle_new(int use, const char *name, int fd, DIR *dirp)
 static int
 handle_is_ok(int i, int type)
 {
-       return i >= 0 && i < sizeof(handles)/sizeof(Handle) &&
+       return i >= 0 && (u_int)i < sizeof(handles)/sizeof(Handle) &&
            handles[i].use == type;
 }
 
@@ -481,10 +477,10 @@ process_write(void)
                } else {
 /* XXX ATOMICIO ? */
                        ret = write(fd, data, len);
-                       if (ret == -1) {
+                       if (ret < 0) {
                                error("process_write: write failed");
                                status = errno_to_portable(errno);
-                       } else if (ret == len) {
+                       } else if ((size_t)ret == len) {
                                status = SSH2_FX_OK;
                        } else {
                                logit("nothing at all written");
This page took 0.186449 seconds and 4 git commands to generate.