awk: fix printf("%c", 0) and the utf() function.
[rsc] --rw-rw-r-- M 357477 glenda sys 12346 Mar 10 10:41 sys/src/cmd/awk/lex.c
/n/sourcesdump/2006/0310/plan9/sys/src/cmd/awk/lex.c:86,93 -
/n/sourcesdump/2006/0311/plan9/sys/src/cmd/awk/lex.c:86,93
{ "system", FSYSTEM, BLTIN },
{ "tolower", FTOLOWER, BLTIN },
{ "toupper", FTOUPPER, BLTIN },
- { "while", WHILE, WHILE },
{ "utf", FUTF, BLTIN },
+ { "while", WHILE, WHILE },
};
#define DEBUG
[rsc] --rw-rw-r-- M 357477 glenda sys 42795 Mar 10 11:44 sys/src/cmd/awk/run.c
/n/sourcesdump/2006/0310/plan9/sys/src/cmd/awk/run.c:903,910 -
/n/sourcesdump/2006/0311/plan9/sys/src/cmd/awk/run.c:903,912
if (isnum(x)) {
if (getfval(x))
sprintf(p, fmt, (int) getfval(x));
- else
+ else{
*p++ = '\0';
+ *p = '\0';
+ }
} else
sprintf(p, fmt, getsval(x)[0]);
break;
|