diff options
author | Kevin Lo <kevlo@cvs.openbsd.org> | 2001-11-20 13:59:53 +0000 |
---|---|---|
committer | Kevin Lo <kevlo@cvs.openbsd.org> | 2001-11-20 13:59:53 +0000 |
commit | d48fee4a9f7ceeecb17cad5c09b462b82f6a28fe (patch) | |
tree | 5fe49e2b29910324ad95b71c439cc6c1ce521d9a /share | |
parent | f4fd37459c3fc1afbd5b416ad690d69c90b93b98 (diff) |
- using fgets instead of gets
- KNF
--
Ok'd by deraadt@
Diffstat (limited to 'share')
-rw-r--r-- | share/lkm/misc/test/testmisc.c | 29 | ||||
-rw-r--r-- | share/lkm/syscall/test/testsyscall.c | 29 |
2 files changed, 28 insertions, 30 deletions
diff --git a/share/lkm/misc/test/testmisc.c b/share/lkm/misc/test/testmisc.c index 66e26878900..e2cd336f2fd 100644 --- a/share/lkm/misc/test/testmisc.c +++ b/share/lkm/misc/test/testmisc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: testmisc.c,v 1.2 2000/03/02 14:46:36 todd Exp $ */ +/* $OpenBSD: testmisc.c,v 1.3 2001/11/20 13:59:50 kevlo Exp $ */ /* * testmisc.c * @@ -40,23 +40,22 @@ */ #include <stdio.h> -main() +int +main(argc, argv) + int argc; + char *argv[]; { - char buf[ 80]; - int err = 0; + char buf[80]; + int err = 0; - printf( "Table offset as reported by modstat: "); - if( gets( buf) == NULL) { - printf( "[ABORT]\n"); - exit( 1); + printf("Table offset as reported by modstat: "); + if (fgets(buf, sizeof(buf), stdin) == NULL) { + printf("[ABORT]\n"); + exit(1); } - if( err = syscall( atoi( buf) /* no arguments*/)) - perror( "syscall"); + if (err = syscall(atoi(buf) /* no arguments*/)) + perror("syscall"); - exit( err); + exit(err); } - -/* - * EOF -- This file has not been truncated - */ diff --git a/share/lkm/syscall/test/testsyscall.c b/share/lkm/syscall/test/testsyscall.c index 86d04ec6746..2df65ac4952 100644 --- a/share/lkm/syscall/test/testsyscall.c +++ b/share/lkm/syscall/test/testsyscall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: testsyscall.c,v 1.2 2000/03/02 14:46:39 todd Exp $ */ +/* $OpenBSD: testsyscall.c,v 1.3 2001/11/20 13:59:52 kevlo Exp $ */ /* * testsyscall.c * @@ -40,23 +40,22 @@ */ #include <stdio.h> -main() +int +main(argc, argv) + int argc; + char* argv[]; { - char buf[ 80]; - int err = 0; + char buf[80]; + int err = 0; - printf( "Table offset as reported by modstat: "); - if( gets( buf) == NULL) { - printf( "[ABORT]\n"); - exit( 1); + printf("Table offset as reported by modstat: "); + if (fgets(buf, sizeof(buf), stdin) == NULL) { + printf("[ABORT]\n"); + exit(1); } - if( err = syscall( atoi( buf) /* no arguments*/)) - perror( "syscall"); + if(err = syscall(atoi(buf) /* no arguments*/)) + perror("syscall"); - exit( err); + exit(err); } - -/* - * EOF -- This file has not been truncated - */ |