Commit e07cf2b0 authored by Kevin Lyda's avatar Kevin Lyda 💬
Browse files

Based on caution / feedback from SA.

parent 9946b1f4
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ read_number() {
  if (!fgets(buf, sizeof buf, stdin)) {
    return 0;
  }
  buf[9] = 0;
  return atoi(buf);
}

@@ -80,9 +81,11 @@ main(int argc, char *argv[]) {
    guess = read_number();
    delta = end_timer(&timer);
    if (guess == 0) {
      if (iterations) {
        printf("Got %d correct out of %d.\n", correct, iterations);
        printf("Average time to answer was %s\n",
            humanize_usec(delta_total / iterations));
      }
      exit(0);
    }
    iterations++;