]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - lib/strncpy_from_user.c
test_firmware: Use correct snprintf() limit
[mirror_ubuntu-bionic-kernel.git] / lib / strncpy_from_user.c
index b53e1b5d80f429e611cd0be58e9ec1079fb68ead..e304b54c9c7dd3a994ec98857503f1d49259f148 100644 (file)
  * hit it), 'max' is the address space maximum (and we return
  * -EFAULT if we hit it).
  */
-static inline long do_strncpy_from_user(char *dst, const char __user *src, long count, unsigned long max)
+static inline long do_strncpy_from_user(char *dst, const char __user *src,
+                                       unsigned long count, unsigned long max)
 {
        const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
-       long res = 0;
+       unsigned long res = 0;
 
        /*
         * Truncate 'max' to the user-specified limit, so that