替代goto
int
foo()
{
int *p = malloc(sizeof (int));
do {
if (bar1() == false) break;
if (bar2() == false) break;
return 1;
} while (0);
free(p);
return 0;
}
int
foo()
{
int *p = malloc(sizeof (int));
do {
if (bar1() == false) break;
if (bar2() == false) break;
return 1;
} while (0);
free(p);
return 0;
}