+ for (i = 0; i < LETTERS; i++)
+ rottbl[lower[i]] = lower[(i + rot) % LETTERS];
+}
+
+static void __attribute__((__noreturn__))
+printrot(const char *arg)
+{
+ int ch;
+ long rot;
+ char *endp;
+
+ errno = 0;
+ rot = strtol(arg, &endp, 10);
+ if (*endp != '\0') {
+ errx(EXIT_FAILURE, "bad rotation value: %s", arg);
+ /* NOTREACHED */
+ }
+ if (errno == ERANGE || rot < 0 || rot > INT_MAX) {
+ errx(EXIT_FAILURE, "rotation value out of range: %s", arg);
+ /* NOTREACHED */
+ }
+ init_rottbl((int)rot);