Index: contrib/one-true-awk/run.c =================================================================== --- contrib/one-true-awk/run.c +++ contrib/one-true-awk/run.c @@ -858,7 +858,7 @@ if (fmtwd < 0) fmtwd = -fmtwd; adjbuf(&buf, &bufsize, fmtwd+1+p-buf, recsize, &p, "format2"); - for (t = fmt; (*t++ = *s) != '\0'; s++) { + for (t = fmt; *(s+1) != '\0' && (*t++ = *s) != '\0'; s++) { if (!adjbuf(&fmt, &fmtsz, MAXNUMSIZE+1+t-fmt, recsize, &t, "format3")) FATAL("format item %.30s... ran format() out of memory", os); /* Ignore size specifiers */