mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
	
		
			310 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
	
		
			310 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /**
 | |
|  g++ memory.error.notcmalloc.cpp -g -O0 -o memory.error.notcmalloc
 | |
|  */
 | |
| #include <unistd.h>
 | |
| #include <string.h>
 | |
| #include <stdio.h>
 | |
| 
 | |
| void foo(char* p){
 | |
|     memcpy(p, "01234567890abcdef", 16);
 | |
| }
 | |
| int main(int argc, char** argv){
 | |
|     char* p = new char[10];
 | |
|     foo(p);
 | |
|     printf("p=%s\n", p);
 | |
|     return 0;
 | |
| }
 |