You can probably use snprintf here instead of strcpy, strcat, strcat.