mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-10-30 19:20:40 -04:00 
			
		
		
		
	Rename variable to avoid a name clash
digits is also a local variable in host_test.function, leading to compilers complaining about that shadowing the global variable in test_suite_base64.function. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
		
							parent
							
								
									ba951f5584
								
							
						
					
					
						commit
						93365a7f45
					
				| @ -4,7 +4,7 @@ | ||||
| #include <test/constant_flow.h> | ||||
| 
 | ||||
| #if defined(MBEDTLS_TEST_HOOKS) | ||||
| static const char digits[] = | ||||
| static const char base64_digits[] = | ||||
|     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | ||||
| #endif /* MBEDTLS_TEST_HOOKS */ | ||||
| 
 | ||||
| @ -45,7 +45,7 @@ void enc_chars( ) | ||||
|         unsigned char digit = mbedtls_base64_enc_char( value ); | ||||
|         TEST_CF_PUBLIC( &value, sizeof( value ) ); | ||||
|         TEST_CF_PUBLIC( &digit, sizeof( digit ) ); | ||||
|         TEST_EQUAL( digit, digits[value] ); | ||||
|         TEST_EQUAL( digit, base64_digits[value] ); | ||||
|     } | ||||
| } | ||||
| /* END_CASE */ | ||||
| @ -59,12 +59,12 @@ void dec_chars( ) | ||||
|     for( unsigned c = 0; c <= 0xff; c++ ) | ||||
|     { | ||||
|         mbedtls_test_set_step( c ); | ||||
|         /* digits is 0-terminated. sizeof()-1 excludes the trailing 0. */ | ||||
|         p = memchr( digits, c, sizeof( digits ) - 1 ); | ||||
|         /* base64_digits is 0-terminated. sizeof()-1 excludes the trailing 0. */ | ||||
|         p = memchr( base64_digits, c, sizeof( base64_digits ) - 1 ); | ||||
|         if( p == NULL ) | ||||
|             expected = -1; | ||||
|         else | ||||
|             expected = p - digits; | ||||
|             expected = p - base64_digits; | ||||
|         TEST_CF_SECRET( &c, sizeof( c ) ); | ||||
|         signed char actual = mbedtls_base64_dec_value( c ); | ||||
|         TEST_CF_PUBLIC( &c, sizeof( c ) ); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Gilles Peskine
						Gilles Peskine