Mercurial > hg > toybox
view toys/yes.c @ 167:f16c8e5e9435
Replace strlcpy() with xstrcpy(), which exits if the string won't fit.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 19 Nov 2007 01:51:00 -0600 |
parents | bb6048c923ec |
children | 25447caf1b4b |
line wrap: on
line source
/* vi: set sw=4 ts=4: */ /* * yes.c - Repeatedly output a string. */ #include "toys.h" int yes_main(void) { for (;;) { int i; for (i=0; toys.optargs[i]; i++) { if (i) xputc(' '); xprintf("%s", toys.optargs[i]); } if (!i) xputc('y'); xputc('\n'); } return 0; }