[1437] in SIPB bug reports

home help back first fref pref prev next nref lref last post

silly char program

daemon@ATHENA.MIT.EDU (Mark W. Eichin)
Tue Nov 13 19:52:22 1990

Date: Tue, 13 Nov 90 19:51:57 -0500
From: Mark W. Eichin <eichin@ATHENA.MIT.EDU>
To: bug-sipb@ATHENA.MIT.EDU

char.c is:
/* This program, hacked by Simson L. Garfinkel, prints to stdout the character for every ASCII value on the command line */
main(argc,argv)
char **argv;
{
     int i,c;

     for(i=1;i<argc;i++){
	  sscanf(argv[i],"%d",&c);
	  putchar(c);
     }
}

Including all of printf usually bloats a program - this could instead be

main(argc,argv) char**argv;
{ 
  for(argc--,argv++;argc;argc--,argv++) { putchar(atoi(*argv)); }
}

Next time I'm online locally I'll install this, hearing no objections,
and fix the man page (it still refers to "/usr/unsupported/sipb", and
suggests using "echo `char 7`" instead of "char 7"...)
						_Mark_

home help back first fref pref prev next nref lref last post