Actually, this line:
/* Set expansion level */
expansion = atoi(argv[++i]);
Is an example of ugly code. They're doing multiple things in one line, and in a confusing order.
# Increment i by 1.
# Grab the command line argument in position i
# Convert from string to integer.
# Assign to the variable expansion.
Note that there's no error checking to handle strings that don't convert to ints.
Arguably, any serious C developer can read this on the fly, but I seriously object to code with side-effects like the above ++i. It's often confusing to read and change.
I'm not criticizing the original author, more nit-picking on this as an example of great code.