Changed as suggested by Frans Meulenbroeks
This commit is contained in:
		
							parent
							
								
									0e6e7bc913
								
							
						
					
					
						commit
						12bc7ed391
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -9,13 +9,13 @@ | |||
| int | ||||
| memcmp(const void *s1, const void *s2, size_t n) | ||||
| { | ||||
| 	register const char *p1 = s1, *p2 = s2; | ||||
| 	register const unsigned char *p1 = s1, *p2 = s2; | ||||
| 
 | ||||
| 	if (n) { | ||||
| 		n++; | ||||
| 		while (--n > 0) { | ||||
| 			if (*p1++ == *p2++) continue; | ||||
| 			return (unsigned char) *--p1 - (unsigned char) *--p2; | ||||
| 			return *--p1 - *--p2; | ||||
| 		} | ||||
| 	} | ||||
| 	return 0; | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue