To comply with C89:
 - Moved variable declarations to top of function
 - Constant output buffer inside the function

Moved strlen calls from main to inside function to make code easier to read.

Also switched from fancy quotes to single quotes in expected output