Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/msdosfs Avoid unsigned/signed comparision warning to ...



details:   https://anonhg.NetBSD.org/src/rev/07bca7338e05
branches:  trunk
changeset: 813522:07bca7338e05
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Feb 01 10:37:57 2016 +0000

description:
Avoid unsigned/signed comparision warning to fix the build.

diffstat:

 sys/fs/msdosfs/msdosfs_conv.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 629f317ed4b3 -r 07bca7338e05 sys/fs/msdosfs/msdosfs_conv.c
--- a/sys/fs/msdosfs/msdosfs_conv.c     Mon Feb 01 08:53:36 2016 +0000
+++ b/sys/fs/msdosfs/msdosfs_conv.c     Mon Feb 01 10:37:57 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_conv.c,v 1.12 2016/02/01 02:59:33 christos Exp $       */
+/*     $NetBSD: msdosfs_conv.c,v 1.13 2016/02/01 10:37:57 martin Exp $ */
 
 /*-
  * Copyright (C) 1995, 1997 Wolfgang Solfrank.
@@ -62,7 +62,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.12 2016/02/01 02:59:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.13 2016/02/01 10:37:57 martin Exp $");
 
 /*
  * System include files.
@@ -1592,7 +1592,7 @@
         */
        len = utf8 ? ucs2utf8str(wn, WIN_CHARS, buf, sizeof(buf)) : ucs2char8str(wn, WIN_CHARS, buf, sizeof(buf));
 
-       if (len > sizeof(dp->d_name) - 1)
+       if (len < 0 || (size_t)len > sizeof(dp->d_name) - 1)
                return -1;
 
        /*



Home | Main Index | Thread Index | Old Index