Skip to content

Instantly share code, notes, and snippets.

@chriskrycho
Created January 20, 2015 19:11
Show Gist options
  • Save chriskrycho/04c06fa79e106a47c3f9 to your computer and use it in GitHub Desktop.
Save chriskrycho/04c06fa79e106a47c3f9 to your computer and use it in GitHub Desktop.
This is real code I found in a file today. This is the *whole* body of the code. AGH.
void g_char(char *a, int alen, char *b)
{
char *x=a+alen-1,
*y=b+alen-1;
while (x >= a && *x == ' ')
{
x--;
y--;
}
*(y+1) = '\0';
while (x >= a)
*y-- = *x--;
} // end g_char
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment