Просмотр исходного кода

u-a: Reduce scope of current pointer in main()

Guillem Jover лет назад: 15
Родитель
Сommit
f9c5414ea3
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      utils/update-alternatives.c

+ 2 - 1
utils/update-alternatives.c

@@ -2261,9 +2261,10 @@ main(int argc, char **argv)
 		exit(0);
 	} else if (strcmp(action, "get-selections") == 0) {
 		struct alternative_map *am;
-		char *current;
 
 		for (am = alt_map_obj; am && am->item; am = am->next) {
+			char *current;
+
 			current = alternative_get_current(am->item);
 			printf("%-30s %-8s %s\n", am->key,
 			       alternative_status_string(am->item->status),