Mercurial > hg > toybox
view toys/clear.c @ 650:dd82e0b28eda
Fix bug spotted by Avery Pennarun: getusername() and getgroupname() can reuse the utoa buffer when neither is recognized, meaning uid would be shown again instead of gid.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 18 Aug 2012 21:12:02 -0500 |
parents | c5c11dff9308 |
children |
line wrap: on
line source
/* vi: set sw=4 ts=4: * * clear.c - clear the screen * * Copyright 2012 Rob Landley <rob@landley.net> * * Not in SUSv4. USE_CLEAR(NEWTOY(clear, NULL, TOYFLAG_USR|TOYFLAG_BIN)) config CLEAR bool "clear" default y help Clear the screen. */ #include "toys.h" void clear_main(void) { write(1, "\e[2J\e[H", 7); }