Bug 73110 - [patch] ffsinfo conversion from atol() to strtol()
Summary: [patch] ffsinfo conversion from atol() to strtol()
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 6.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Robert Watson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-25 12:10 UTC by Giorgos Keramidas
Modified: 2008-01-13 16:11 UTC (History)
0 users

See Also:


Attachments
ffsinfo.patch (1.07 KB, patch)
2004-10-25 12:10 UTC, Giorgos Keramidas
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Giorgos Keramidas freebsd_committer freebsd_triage 2004-10-25 12:10:14 UTC
The ffsinfo utility uses atol() to parse numeric values out of optarg strings.
This isn't necessarily a bug, but it can be slightly inconvenient, because
atol() doesn't know how to parse hexadecimal or octal numbers and at least one
of the options of ffsinfo(8) would be easier to use if it did.

Changing atol() -> strtol() allows one to use hex masks for -l MASK, i.e.:

orion:/a/freebsd/src/sbin/ffsinfo# ./ffsinfo -l 0x3ff /

A word of caution: the source of ffsinfo.c does not follow style(9).  This is
why I used a style similar to the one of the original source in my diff.
Comment 1 Robert Watson freebsd_committer freebsd_triage 2005-01-03 18:58:09 UTC
State Changed
From-To: open->patched

Applied as ffsinfo.c:1.7 in FreeBSD CVS HEAD.  Will MFC after two weeks. 
Thanks! 



Comment 2 Robert Watson freebsd_committer freebsd_triage 2005-01-03 18:58:09 UTC
Responsible Changed
From-To: freebsd-bugs->rwatson

Grab ownership of this PR.
Comment 3 Robert Watson freebsd_committer freebsd_triage 2008-01-13 16:11:30 UTC
State Changed
From-To: patched->closed

Patch was applied.