wovo / hwlib

C++ OO micro-controller library for close-to-the-hardware programming
Boost Software License 1.0
57 stars 26 forks source link

Fixed comparison not working for non-null terminated strings #6

Closed ManDeJan closed 6 years ago

ManDeJan commented 7 years ago

I was having issues with comparing strings and it turns out strings can only be equal if they are null terminated, my strings where not.

Non null terminated strings are equal to any other string

Stop this racism.

Bob-Thomas commented 7 years ago

+1

CvRXX commented 6 years ago

I just saw this after I made a pull myself. Only problem with your fix is that the comparisson "testtest" and "testtesttest" is true. You should check if the pointer is at the end of the hwlib::string.

ManDeJan commented 6 years ago

Closed since Wouter fixed string