Change sprintf to snprintf
cal.c:40: warning: sprintf() is often misused, please use snprintf()
This commit is contained in:
		
							
								
								
									
										2
									
								
								cal.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								cal.c
									
									
									
									
									
								
							@@ -37,7 +37,7 @@ drawcal(int year, int month, int day, int ncols, int nmons, int fday)
 | 
				
			|||||||
			cur = moff % 12;
 | 
								cur = moff % 12;
 | 
				
			||||||
			yoff = year + moff / 12;
 | 
								yoff = year + moff / 12;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			sprintf(str, "%s %d", smon[cur], yoff);
 | 
								snprintf(str, sizeof(str), "%s %d", smon[cur], yoff);
 | 
				
			||||||
			printf("%-20s   ", str);
 | 
								printf("%-20s   ", str);
 | 
				
			||||||
			count[i] = 1;
 | 
								count[i] = 1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user