diff options
Diffstat (limited to 'tester/covoar/Target_m68k.cc')
-rw-r--r-- | tester/covoar/Target_m68k.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tester/covoar/Target_m68k.cc b/tester/covoar/Target_m68k.cc index 536ae80..7c761be 100644 --- a/tester/covoar/Target_m68k.cc +++ b/tester/covoar/Target_m68k.cc @@ -77,11 +77,13 @@ namespace Target { } bool Target_m68k::isNopLine( - const char* const line, - int& size + const std::string& line, + int& size ) { - if (!strcmp( &line[strlen(line)-3], "nop")) { + size_t stringLen = line.length(); + + if ( line.substr( stringLen - 3 ) == "nop" ) { size = 2; return true; } @@ -89,7 +91,7 @@ namespace Target { #define GNU_LD_FILLS_ALIGNMENT_WITH_RTS #if defined(GNU_LD_FILLS_ALIGNMENT_WITH_RTS) // Until binutils 2.20, binutils would fill with rts not nop - if (!strcmp( &line[strlen(line)-3], "rts")) { + if ( line.substr( stringLen - 3 ) == "rts" ) { size = 4; return true; } @@ -99,7 +101,7 @@ namespace Target { } bool Target_m68k::isBranch( - const char* const instruction + const std::string& instruction ) { throw rld::error( |