FreeBSD Bugzilla – Attachment 47736 Details for
Bug 73110
[patch] ffsinfo conversion from atol() to strtol()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
ffsinfo.patch
ffsinfo.patch (text/plain), 1.07 KB, created by
Giorgos Keramidas
on 2004-10-25 12:10:14 UTC
(
hide
)
Description:
ffsinfo.patch
Filename:
MIME Type:
Creator:
Giorgos Keramidas
Created:
2004-10-25 12:10:14 UTC
Size:
1.07 KB
patch
obsolete
>Index: ffsinfo.c >=================================================================== >RCS file: /home/ncvs/src/sbin/ffsinfo/ffsinfo.c,v >retrieving revision 1.7 >diff -u -u -r1.7 ffsinfo.c >--- ffsinfo.c 26 Jul 2004 15:04:57 -0000 1.7 >+++ ffsinfo.c 25 Oct 2004 11:02:19 -0000 >@@ -63,6 +63,7 @@ > > #include <ctype.h> > #include <err.h> >+#include <errno.h> > #include <fcntl.h> > #include <libufs.h> > #include <paths.h> >@@ -148,19 +149,25 @@ > while ((ch=getopt(argc, argv, "g:i:l:o:")) != -1) { > switch(ch) { > case 'g': >- cfg_cg=atol(optarg); >+ cfg_cg=strtol(optarg, NULL, 0); >+ if(errno == EINVAL||errno == ERANGE) >+ err(1, "%s", optarg); > if(cfg_cg < -1) { > usage(); > } > break; > case 'i': >- cfg_in=atol(optarg); >+ cfg_in=strtol(optarg, NULL, 0); >+ if(errno == EINVAL||errno == ERANGE) >+ err(1, "%s", optarg); > if(cfg_in < 0) { > usage(); > } > break; > case 'l': >- cfg_lv=atol(optarg); >+ cfg_lv=strtol(optarg, NULL, 0); >+ if(errno == EINVAL||errno == ERANGE) >+ err(1, "%s", optarg); > if(cfg_lv < 0x1||cfg_lv > 0x3ff) { > usage(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 73110
: 47736