Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
MacroModel committed Nov 27, 2024
1 parent 6cbc394 commit 141bfbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion examples/0036.at/chmod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ int main(int argc, char **argv)
#endif
{
::std::uint_least32_t perm;
::fast_io::scan(::fast_io::mnp::os_c_str(argv[2]), perm);
auto const [p1, e1] = ::fast_io::parse_by_scan(argv[2], argv[2] + ::fast_io::cstr_len(argv[2]), ::fast_io::mnp::base_get<8>(perm));
if (e1 != ::fast_io::parse_code::ok)
{
::fast_io::throw_parse_code(e1);
}

::fast_io::native_fchmodat(::fast_io::at_fdcwd(), fast_io::mnp::os_c_str(argv[1]), static_cast<::fast_io::perms>(perm));
}
#if __cpp_exceptions
Expand Down
4 changes: 2 additions & 2 deletions examples/0036.at/chown.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ int main(int argc, char **argv)
::std::uint_least64_t o;
::std::uint_least64_t g;

auto const [p1,e1]= ::fast_io::parse_by_scan(argv[2], argv[2] + ::fast_io::cstr_len(argv[2]), ::fast_io::mnp::base_get<8>(o));
auto const [p1,e1]= ::fast_io::parse_by_scan(argv[2], argv[2] + ::fast_io::cstr_len(argv[2]), o);
if (e1 != ::fast_io::parse_code::ok)
{
::fast_io::throw_parse_code(e1);
}
auto const [p2, e2] = ::fast_io::parse_by_scan(argv[3], argv[3] + ::fast_io::cstr_len(argv[3]), ::fast_io::mnp::base_get<8>(g));
auto const [p2, e2] = ::fast_io::parse_by_scan(argv[3], argv[3] + ::fast_io::cstr_len(argv[3]), g);
if (e2 != ::fast_io::parse_code::ok)
{
::fast_io::throw_parse_code(e2);
Expand Down

0 comments on commit 141bfbd

Please sign in to comment.