if (rval & 0x100)
if (done)
int printfcmd(int argc, char *argv[]){	char *fmt;	char *format;	int ch;	rval = 0;	nextopt(nullstr);	argv = argptr;	format = *argv;	if (!format) {		warnx("usage: printf format [arg ...]");		goto err;	}	gargv = ++argv;#define SKIP1	"#-+ 0"#define SKIP2	"*0123456789"	do {		/*		 * Basic algorithm is to scan the format string for conversion		 * specifications -- once one is found, find out if the field		 * width or precision is a '*'; if it is, gather up value. 		 * Note, format strings are reused as necessary to use up the		 * provided arguments, arguments of zero/null string are 		 * provided to use up the format string.		 */		/* find next format specification */		for (fmt = format; (ch = *fmt++) ;) {			char *start;			char nextch;			int array[2];			int *param;			if (ch == '\\') {				int c_ch;				fmt = conv_escape(fmt, &c_ch);				ch = c_ch;				goto pc;			}			if (ch != '%' || (*fmt == '%' && (++fmt || 1))) {pc:				putchar(ch);				continue;			}			/* Ok - we've found a format specification,			   Save its address for a later printf(). */			start = fmt - 1;			param = array;			/* skip to field width */			fmt += strspn(fmt, SKIP1);			if (*fmt == '*')				*param++ = getintmax();			/* skip to possible '.', get following precision */			fmt += strspn(fmt, SKIP2);			if (*fmt == '.')				++fmt;			if (*fmt == '*')				*param++ = getintmax();			fmt += strspn(fmt, SKIP2);			ch = *fmt;			if (!ch) {				warnx("missing format character");				goto err;			}			/* null terminate format string to we can use it			   as an argument to printf. */			nextch = fmt[1];			fmt[1] = 0;			switch (ch) {			case 'b': {				char *p = conv_escape_str(getstr());				*fmt = 's';				PF(start, p);				/* escape if a \c was encountered */				if (rval & 0x100)					goto out;				*fmt = 'b';				break;			}			case 'c': {				int p = getchr();				PF(start, p);				break;			}			case 's': {				char *p = getstr();				PF(start, p);				break;			}			case 'd':			case 'i': {				intmax_t p = getintmax();				char *f = mklong(start, fmt);				PF(f, p);				break;			}			case 'o':			case 'u':			case 'x':			case 'X': {				uintmax_t p = getuintmax();				char *f = mklong(start, fmt);				PF(f, p);				break;			}			case 'e':			case 'E':			case 'f':			case 'g':			case 'G': {				double p = getdouble();				PF(start, p);				break;			}			default:				warnx("%s: invalid directive", start);				goto err;			}			*++fmt = nextch;		}	} while (gargv != argv && *gargv);out:	return (rval & ~0x100);err:	return 1;}