Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcmips/stand/libsa PR/52446: Devid Binderman: Fix ...



details:   https://anonhg.NetBSD.org/src/rev/18eb353ce867
branches:  trunk
changeset: 825821:18eb353ce867
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Aug 01 11:58:45 2017 +0000

description:
PR/52446: Devid Binderman: Fix error checking for wcstombs

diffstat:

 sys/arch/hpcmips/stand/libsa/devopen.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 1e3ae4e9ab49 -r 18eb353ce867 sys/arch/hpcmips/stand/libsa/devopen.c
--- a/sys/arch/hpcmips/stand/libsa/devopen.c    Tue Aug 01 11:56:58 2017 +0000
+++ b/sys/arch/hpcmips/stand/libsa/devopen.c    Tue Aug 01 11:58:45 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.6 2009/03/14 21:04:09 dsl Exp $  */
+/*     $NetBSD: devopen.c,v 1.7 2017/08/01 11:58:45 christos Exp $     */
 
 /*-
  * Copyright (c) 1999 Shin Takemura.
@@ -80,7 +80,7 @@
        } else {
                static char name[1024]; /* XXX */
 
-               if (wcstombs(name, (TCHAR*)fname, sizeof(name)) < 0) {
+               if (wcstombs(name, (TCHAR*)fname, sizeof(name)) == (size_t)-1) {
                        return (ENOENT);
                }
                if ('1' <= name[0] && name[0] <= '9' && name[1] == ':') {



Home | Main Index | Thread Index | Old Index