hamurabi: input in base 10.
authorBrett Gordon <beretta42@gmail.com>
Sun, 13 May 2018 03:56:45 +0000 (23:56 -0400)
committerBrett Gordon <beretta42@gmail.com>
Sun, 13 May 2018 03:56:45 +0000 (23:56 -0400)
Applications/games/hamurabi.c

index 1405481..1523e32 100644 (file)
@@ -262,7 +262,7 @@ uint16_t input(void) {
   if (fgets(input, 16, stdin) == NULL)
    exit(EXIT_FAILURE);
   errno = 0;
-  q = (uint16_t) strtol(input, &endptr, 16);
+  q = (uint16_t) strtol(input, &endptr, 10);
   if ((errno == ERANGE && (q == LONG_MAX || q == LONG_MIN))
       || (errno != 0 && q == 0)) {
     perror("strtol");