generate_random_data: return early on invalid arg
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-14 05:44:37 +01:00
parent 53cde1371f
commit 57fae8f582
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -143,7 +143,10 @@ auto Generator::generate_random_data(uint n) -> std::string {
// do not do this..?
const std::string msg{"zero bytes requested, bailing\n"};
fmt::print("[*] g: error: {}", msg);
throw std::invalid_argument(msg);
// throw std::invalid_argument(msg);
// TODO(me): throw or not?
// perhaps just return prematurely
return "";
}
// pre-computed 2^20