Source-Changes-HG archive

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

[src/trunk]: src/lib/libusbhid minor type fixes.



details:   https://anonhg.NetBSD.org/src/rev/25b71506045e
branches:  trunk
changeset: 342642:25b71506045e
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 02 21:58:10 2016 +0000

description:
minor type fixes.

diffstat:

 lib/libusbhid/usage.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r 116d1649401e -r 25b71506045e lib/libusbhid/usage.c
--- a/lib/libusbhid/usage.c     Sat Jan 02 20:57:10 2016 +0000
+++ b/lib/libusbhid/usage.c     Sat Jan 02 21:58:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usage.c,v 1.9 2016/01/02 01:24:44 jakllsch Exp $       */
+/*     $NetBSD: usage.c,v 1.10 2016/01/02 21:58:10 christos Exp $      */
 
 /*
  * Copyright (c) 1999 Lennart Augustsson <augustss%NetBSD.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: usage.c,v 1.9 2016/01/02 01:24:44 jakllsch Exp $");
+__RCSID("$NetBSD: usage.c,v 1.10 2016/01/02 21:58:10 christos Exp $");
 
 #include <assert.h>
 #include <ctype.h>
@@ -86,7 +86,7 @@
        if (f == NULL)
                err(1, "%s", hidname);
        for (lineno = 1; ; lineno++) {
-               if (fgets(line, sizeof line, f) == NULL)
+               if (fgets(line, (int)sizeof(line), f) == NULL)
                        break;
                if (line[0] == '#')
                        continue;
@@ -220,15 +220,16 @@
        const char *sep;
        int k, j;
        unsigned int l;
+       size_t len;
 
        _DIAGASSERT(name != NULL);
 
        sep = strchr(name, ':');
        if (sep == NULL)
                return -1;
-       l = sep - name;
+       len = sep - name;
        for (k = 0; k < npages; k++)
-               if (strncmp(pages[k].name, name, l) == 0)
+               if (strncmp(pages[k].name, name, len) == 0)
                        goto found;
        if (sscanf(name, "%x:%x", &k, &j) == 2) {
                return (k << 16) | j;



Home | Main Index | Thread Index | Old Index