int opts_for_fsck = 0;
struct sigaction sa;
int report_stats_fd = -1;
- uint64_t num;
/*
* Set up signal action
if (getenv("FSCK_FORCE_ALL_PARALLEL"))
force_all_parallel++;
- if (ul_strtou64(getenv("FSCK_MAX_INST"), &num, 10) == 0 && num <= INT_MAX)
- max_running = num;
+ if (ul_strtos32(getenv("FSCK_MAX_INST"), &max_running, 10) != 0)
+ max_running = 0;
}
int main(int argc, char *argv[])
/* find line "drive speed" and read the correct speed */
} else {
if (strncmp(line, "drive speed:", 12) == 0) {
- uint64_t n;
+ int n;
fclose(f);
str = line + 12;
normalize_whitespace((unsigned char *) str);
- if (ul_strtou64(str, &n, 10) == 0 && n <= INT_MAX)
- return (int) n;
+ if (ul_strtos32(str, &n, 10) == 0)
+ return n;
errx(EXIT_FAILURE, _("%s: failed to read speed"),
_PATH_PROC_CDROMINFO);
if (keynum >= 0)
id = keynum;
else {
- uint64_t n;
- if (ul_strtou64(value, &n, 10) == 0 && n <= INT_MAX)
+ uint32_t n;
+ if (ul_strtou32(value, &n, 10) == 0)
id = n;
}
struct winsize winsz;
int badioctl;
#endif
- char *p;
-
if (initialized == 0) {
- if ((p = getenv("LINES")) != NULL && *p != '\0')
- if ((envlines = atoi(p)) < 0)
- envlines = 0;
- if ((p = getenv("COLUMNS")) != NULL && *p != '\0')
- if ((envcols = atoi(p)) < 0)
- envcols = 0;
+ uint32_t tmp = 0;
+
+ if (ul_strtou32(getenv("LINES"), &tmp, 10) == 0)
+ envlines = tmp;
+ if (ul_strtou32(getenv("COLUMNS"), &tmp, 10) == 0)
+ envcols = tmp;
+
/* terminfo values. */
if (tinfostat != 1 || columns == 0)
defcols = 24;