--- cfg_syn.c 2002/07/05 14:33:10 1.3
+++ cfg_syn.c 2002/07/05 15:21:19 1.4
@@ -167,20 +167,22 @@
{
int i;
char *cp;
+ char *cp2;
va_list ap;
char *str;
va_start(ap, fmt);
if ((str = cfg_fmt_vasprintf(fmt, ap)) == NULL)
return;
- while ((cp = strchr(str, '\n')) != NULL) {
- cfg_buf_format(ctx->buf, "%.*s", cp-str+1, str);
+ cp = str;
+ while ((cp2 = strchr(cp, '\n')) != NULL) {
+ cfg_buf_format(ctx->buf, "%.*s", cp2-cp+1, cp);
for (i = 0; i < ctx->indent; i++)
cfg_buf_format(ctx->buf, " ");
- str = cp+1;
+ cp = cp2+1;
}
- if (str[0] != '\0')
- cfg_buf_format(ctx->buf, "%s", str);
+ if (cp[0] != '\0')
+ cfg_buf_format(ctx->buf, "%s", cp);
free(str);
va_end(ap);
return;
|