Skip to content

Instantly share code, notes, and snippets.

@kiryl
Created August 24, 2011 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiryl/1167755 to your computer and use it in GitHub Desktop.
Save kiryl/1167755 to your computer and use it in GitHub Desktop.
int error(void);
int baz(char **, const char *);
int quux(char *);
static int bar(char **out, const char *in)
{
char *t;
int err;
err = baz(&t, in);
if (err < 0)
return error();
*out = t;
return 0;
}
int foo(const char *a)
{
int err;
char *b;
err = bar(&b, a);
if (err < 0)
return error();
return quux(b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment