]> err.no Git - yubikey-personalization/commitdiff
use sizeof() on the static string instead of strlen()
authorKlas Lindfors <klas@yubico.com>
Tue, 4 Dec 2012 19:15:44 +0000 (20:15 +0100)
committerKlas Lindfors <klas@yubico.com>
Tue, 4 Dec 2012 19:15:44 +0000 (20:15 +0100)
tests/test_args_to_config.c
ykpersonalize.c

index fe0a9dfa7307b0632ace8d2d5fb63d2ee9cd6c63..87e84ae47a7f4a2e19a68be0cc8a0e50bd8ea7f5 100644 (file)
@@ -118,7 +118,7 @@ int _test_config (YKP_CONFIG *cfg, YK_STATUS *st, int argc, char **argv)
        unsigned char usb_mode = -1;
        bool zap = false;
 
-       unsigned char scan_map[strlen(SCAN_MAP)];
+       unsigned char scan_map[sizeof(SCAN_MAP)];
 
        int rc;
 
@@ -299,7 +299,7 @@ int _test_non_config_args(void)
        unsigned char usb_mode = -1;
        bool zap = false;
 
-       unsigned char scan_map[strlen(SCAN_MAP)];
+       unsigned char scan_map[sizeof(SCAN_MAP)];
 
        char *argv[] = {
                "unittest", "-1", "-sout", "-iin", "-c313233343536", "-y", "-v",
index a130b67c9c90e083b0992be4ffc69a6b757730a1..3491c7e5ced299c3a3a3ae4c2dda09344fc19f1d 100644 (file)
@@ -58,7 +58,7 @@ int main(int argc, char **argv)
        bool aesviahash = false;
        bool use_access_code = false;
        unsigned char access_code[256];
-       unsigned char scan_codes[strlen(SCAN_MAP)];
+       unsigned char scan_codes[sizeof(SCAN_MAP)];
        YK_KEY *yk = 0;
        YKP_CONFIG *cfg = ykp_alloc();
        YK_STATUS *st = ykds_alloc();