]> the.earth.li Git - onak.git/commitdiff
Use strtouq to parse keyid instead of strtoul
authorJonathan McDowell <noodles@earth.li>
Tue, 30 Sep 2014 21:34:21 +0000 (22:34 +0100)
committerJonathan McDowell <noodles@earth.li>
Tue, 30 Sep 2014 21:34:21 +0000 (22:34 +0100)
The use of strtoul to parse the key ID breaks parsing 64 bit key IDs
on 32 bit platforms. Use strtouq instead, which is defined as returning
a 64 bit rather than being dependant on the length of "unsigned long".

onak.c

diff --git a/onak.c b/onak.c
index ad86cb04bef6ff829c78034030ae314ccdb005f4..0c4673d7704323723c53133b9cc429f2700bd5c9 100644 (file)
--- a/onak.c
+++ b/onak.c
@@ -330,7 +330,7 @@ int main(int argc, char *argv[])
                        }
                        isfp = true;
                } else if (search != NULL) {
-                       keyid = strtoul(search, &end, 16);
+                       keyid = strtouq(search, &end, 16);
                        if (*search != 0 &&
                                        end != NULL &&
                                        *end == 0) {