Waitrud Weber’s blog

things and reminders for memories

Code Analyzer: String function 005

566 :int m_contains ( char* c_str, char* c_ref ) {
567 :
568 :	int unmatch = 0;
569 :	int ref_length = array_count( c_ref );
570 :	int length = array_count( c_str );
571 :	for ( int i=length -1; i >= 0; i-- ) {
572 :		for ( int j=ref_length -1; j >= 0; j-- ) {
573 :			// sprintf("m_contains:|%d|%d|\r\n", c_str[i] , c_ref[j] );
574 :			if ( c_str[i] != c_ref[ j ] ) {
575 :				unmatch = 1;
576 :			}
577 :		}
578 :		if ( unmatch == 0 ) return 1;
579 :		else unmatch = 0;
580 :	}
581 :
582 :	return 0;
583 :}

https://waitrudweber.hatenablog.com/entry/2019/03/10/004908