Skip to content

Commit

Permalink
Allow the random seed to be a negative value.
Browse files Browse the repository at this point in the history
  • Loading branch information
alfmep committed Mar 17, 2022
1 parent e4ce719 commit 59c56e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/appargs.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (C) 2022 Dan Arrhenius <dan@ultramarin.se>
* Copyright (C) 2017,2021 Ultramarin Design AB <dan@ultramarin.se>
*
* This file is part of macgen.
Expand Down Expand Up @@ -118,7 +119,7 @@ namespace macgen {
break;
case 's':
try {
seed = (unsigned long) std::stol (optarg, nullptr, 0);
seed = std::stoll (optarg, nullptr, 0);
}catch(...) {
std::cerr << "Error: Invalid seed value: " << optarg
<< " (use option '-h' for help)" << std::endl;
Expand Down
3 changes: 2 additions & 1 deletion src/appargs.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (C) 2022 Dan Arrhenius <dan@ultramarin.se>
* Copyright (C) 2017,2021 Ultramarin Design AB <dan@ultramarin.se>
*
* This file is part of macgen.
Expand Down Expand Up @@ -28,7 +29,7 @@ namespace macgen {
bool uppercase;
bool no_newline;
int repeat;
unsigned long seed;
long long seed;

appargs (int argc, char* argv[]);
};
Expand Down

0 comments on commit 59c56e4

Please sign in to comment.