diff --git a/ch13/Projects/10.c b/ch13/Projects/10.c index cbf20ab..3950144 100644 --- a/ch13/Projects/10.c +++ b/ch13/Projects/10.c @@ -25,7 +25,10 @@ void reverse_name(char *name) initial = *p++; while (*p && *p++ != ' '); - + + while (*p && *p == ' ') + p++; + while (*p && *p != '\n') putchar(*p++); printf(", %c.", initial);