fix: strncpy limits
This commit is contained in:
		
							parent
							
								
									831291cdac
								
							
						
					
					
						commit
						fc0e0b660a
					
				
					 3 changed files with 9 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -40,10 +40,10 @@ relay_db_select_mapper(sqlite3_stmt *stmt)
 | 
			
		|||
        switch(name[0])
 | 
			
		||||
        {
 | 
			
		||||
            case 'a': // active_schedule_id
 | 
			
		||||
                strncpy(new_relay->active_schedule_id, (const char*)sqlite3_column_text(stmt, i), 33);
 | 
			
		||||
                strncpy(new_relay->active_schedule_id, (const char*)sqlite3_column_text(stmt, i), 32);
 | 
			
		||||
                break;
 | 
			
		||||
            case 'c': // controller_id
 | 
			
		||||
                strncpy(new_relay->controller_id, (const char*)sqlite3_column_text(stmt, i), 33);
 | 
			
		||||
                strncpy(new_relay->controller_id, (const char*)sqlite3_column_text(stmt, i), 32);
 | 
			
		||||
                break;
 | 
			
		||||
            case 'i':
 | 
			
		||||
                new_relay->id = sqlite3_column_int(stmt, i);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue