View | Details | Raw Unified | Return to bug 229641 | Differences between
and this patch

Collapse All | Expand All

(-)usr.bin/printf/printf.c (-3 / +8 lines)
Lines 374-387 Link Here
374
		size_t len;
374
		size_t len;
375
		char *p;
375
		char *p;
376
		int getout;
376
		int getout;
377
		char *bfmt;
377
378
378
		p = strdup(getstr());
379
		if (((bfmt = strdup(start)) == NULL) ||
379
		if (p == NULL) {
380
		    ((p = strdup(getstr())) == NULL)) {
380
			warnx("%s", strerror(ENOMEM));
381
			warnx("%s", strerror(ENOMEM));
381
			return (NULL);
382
			return (NULL);
382
		}
383
		}
384
		/* Convert "b" to "s" for output. */
385
		bfmt[strlen(bfmt) - 1] = 's';
383
		getout = escape(p, 0, &len);
386
		getout = escape(p, 0, &len);
384
		fputs(p, stdout);
387
		PF(bfmt, p);
388
389
		free(bfmt);
385
		free(p);
390
		free(p);
386
		if (getout)
391
		if (getout)
387
			return (end_fmt);
392
			return (end_fmt);

Return to bug 229641