IntelRealSense / RealSenseID

Intel® RealSense™ ID SDK
https://intelrealsense.com/facial-authentication/
Apache License 2.0
98 stars 57 forks source link

Made the whitespace trimming less fragile #69

Closed michalrudowicz closed 3 years ago

michalrudowicz commented 3 years ago

For some reason my wc output has only one whitespace character at the end of its output instead of - as assumed in this function - two. This caused the following exception to be raised:

terminate called after throwing an instance of 'std::invalid_argument'
  what():  stoi

My understanding is that the idea behind the pop_back() calls are to trim the whitespace from the end of the command output, so I've replaced this with an implementation that should not depend on the exact number of whitespace characters.

AradDor commented 3 years ago

Thanks @michalrudowicz ! Merged.