Use estrtol() instead of atoi()

Some more stylistic fixes.
This commit is contained in:
sin 2014-06-30 16:50:29 +01:00
parent 643a714256
commit 55dbbb7b3f
1 changed files with 11 additions and 10 deletions

9
chvt.c
View File

@ -1,10 +1,11 @@
/* See LICENSE file for copyright and license details. */
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <unistd.h>
#include "util.h"
#define KDGKBTYPE 0x4B33 /* get keyboard type */
@ -35,7 +36,7 @@ main(int argc, char *argv[])
if (argc != 2 || strspn(argv[1], "1234567890") != strlen(argv[1]))
usage();
n = atoi(argv[1]);
n = estrtol(argv[1], 10);
for (i = 0; i < LEN(vts); i++) {
fd = open(vts[i], O_RDONLY);
if (fd < 1)