Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug with length calculation #601

Merged
merged 1 commit into from
Feb 28, 2014

Conversation

cehberlin
Copy link
Contributor

Because the string length is calculated with an additional '/' it is necessary to add this character as well to the substring creation. If not it is possible to get out of range errors like below. Another possibility would be to remove the extra '/' from the length calculation in line 396 and 397, but I do not know if this has any side effects

Fixed build errors like below:
-- Using CATKIN_TEST_RESULTS_DIR:
~/ros_catkin_ws/build_isolated/rqt_image_view/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- catkin 0.5.84
CMake Error at
/opt/ros/hydro/share/catkin/cmake/catkin_package.cmake:399
(string):
string end index: 57 is out of range -1 - 56

Fixed build errors like below:
-- Using CATKIN_TEST_RESULTS_DIR:
~/ros_catkin_ws/build_isolated/rqt_image_view/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- catkin 0.5.84
CMake Error at
/opt/ros/hydro_custom/share/catkin/cmake/catkin_package.cmake:399
(string):
  string end index: 57 is out of range -1 - 56
@dirk-thomas
Copy link
Member

Thank you for catching this case.

The suffix must be there to avoid matching two paths like /foo with /foobar.

dirk-thomas added a commit that referenced this pull request Feb 28, 2014
Fixed bug with length calculation
@dirk-thomas dirk-thomas merged commit 84e466d into ros:indigo-devel Feb 28, 2014
cwecht pushed a commit to cwecht/catkin that referenced this pull request Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants