truncated for length. SVN 14135 made sure that the truncated version would
always be null terminated. SVN 14144 broke this for no readily apparent
reason, and I have no idea what it was even trying to accomplish. Reverted.
{
FILE *fd;
int c;
- char buf[256+2];
+ char buf[256];
const char *outbuf;
time_t t;
struct utsname uts;
case 'D':
case 'o':
- buf[0] = '\0';
- getdomainname(buf, sizeof(buf) - 1);
+ getdomainname(buf, sizeof(buf));
+ buf[sizeof(buf) - 1] = '\0';
break;
case 'd':
break;
case 'h':
- buf[0] = '\0';
gethostname(buf, sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = '\0';
break;
case 'l':
{
char buf[MAXHOSTNAMELEN+1];
- if(gethostname(buf, MAXHOSTNAMELEN) == 0)
- fputs(buf, stdout);
+ gethostname(buf, MAXHOSTNAMELEN);
+ fputs(buf, stdout);
fputs(LOGIN, stdout);
fflush(stdout);