Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure to check for empty extension before accessing front. (#1764)
The documentation for std::string::front() says that calling it on an empty string is undefined behavior. It actually seems to work on all platforms except Windows Debug, where it throws an error. Make sure to check for empty first. We also notice that there is no reason to check the existing_sub_namespace for empty; the rest of the code handles that fine. So remove that check. Finally, we add an anonymous namespace so that these functions do not pollute the global namespace. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
- Loading branch information