mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	json: check spa_json_get_string() return value correctly
It is only successful when > 0.
This commit is contained in:
		
							parent
							
								
									13c0cbb899
								
							
						
					
					
						commit
						68b31d37d9
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -183,7 +183,7 @@ static void load_quirks(struct spa_bt_quirks *this, const char *str, size_t len)
 | 
				
			||||||
	if (spa_json_enter_object(&data, &rules) <= 0)
 | 
						if (spa_json_enter_object(&data, &rules) <= 0)
 | 
				
			||||||
		spa_json_init(&rules, str, len);
 | 
							spa_json_init(&rules, str, len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (spa_json_get_string(&rules, key, sizeof(key)-1)) {
 | 
						while (spa_json_get_string(&rules, key, sizeof(key)-1) > 0) {
 | 
				
			||||||
		int sz;
 | 
							int sz;
 | 
				
			||||||
		const char *value;
 | 
							const char *value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -166,7 +166,7 @@ int pw_properties_update_string(struct pw_properties *props, const char *str, si
 | 
				
			||||||
	if (spa_json_enter_object(&it[0], &it[1]) <= 0)
 | 
						if (spa_json_enter_object(&it[0], &it[1]) <= 0)
 | 
				
			||||||
		spa_json_init(&it[1], str, size);
 | 
							spa_json_init(&it[1], str, size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (spa_json_get_string(&it[1], key, sizeof(key)-1)) {
 | 
						while (spa_json_get_string(&it[1], key, sizeof(key)-1) > 0) {
 | 
				
			||||||
		int len;
 | 
							int len;
 | 
				
			||||||
		const char *value;
 | 
							const char *value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue