Source-Changes-HG archive

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

[src/trunk]: src/lib/libutil KNF, sign cast.



details:   https://anonhg.NetBSD.org/src/rev/3e0969f7c6aa
branches:  trunk
changeset: 332360:3e0969f7c6aa
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Sep 17 23:54:42 2014 +0000

description:
KNF, sign cast.

diffstat:

 lib/libutil/getdiskrawname.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 06586be7ca48 -r 3e0969f7c6aa lib/libutil/getdiskrawname.c
--- a/lib/libutil/getdiskrawname.c      Wed Sep 17 21:18:43 2014 +0000
+++ b/lib/libutil/getdiskrawname.c      Wed Sep 17 23:54:42 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getdiskrawname.c,v 1.4 2014/09/12 11:38:23 mlelstv Exp $       */
+/*     $NetBSD: getdiskrawname.c,v 1.5 2014/09/17 23:54:42 christos Exp $      */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: getdiskrawname.c,v 1.4 2014/09/12 11:38:23 mlelstv Exp $");
+__RCSID("$NetBSD: getdiskrawname.c,v 1.5 2014/09/17 23:54:42 christos Exp $");
 
 #include <sys/stat.h>
 
@@ -47,7 +47,7 @@
        size_t nlen;
        ssize_t dlen;
 
-       dlen = readlink(name, buf, bufsiz-1);
+       dlen = readlink(name, buf, bufsiz - 1);
        if (dlen == -1)
                return name;
 
@@ -62,7 +62,7 @@
                        if (nlen + dlen + 1 > bufsiz)
                                return NULL;
 
-                       memmove(buf+nlen, buf, dlen+1);
+                       memmove(buf + nlen, buf, (size_t)dlen + 1);
                        memcpy(buf, name, nlen);
                }
        }



Home | Main Index | Thread Index | Old Index