mirror of
				https://github.com/sheumann/AFPBridge.git
				synced 2025-10-31 11:26:45 -07:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			329 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			329 B
		
	
	
	
		
			C
		
	
	
	
	
	
| # ifdef __ORCAC__
 | |
| #  pragma noroot
 | |
| # endif
 | |
| 
 | |
| #include <stddef.h>
 | |
| #include <ctype.h>
 | |
| 
 | |
| int strncasecmp(const char *s1, const char *s2, size_t n)
 | |
| {
 | |
|     if (n == 0)
 | |
|         return 0;
 | |
| 
 | |
|     while (n > 1 && *s1 != 0 && tolower(*s1) == tolower(*s2)) {
 | |
|         s1++;
 | |
|         s2++;
 | |
|         n--;
 | |
|     }
 | |
|     
 | |
|     return (int)*s1 - (int)*s2;
 | |
| }
 |