home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
PROGRAMM
/
SNIP0492.ZIP
/
UUDECODE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-08-27
|
959b
|
36 lines
/*
** by: John Lots
*/
#include <stdio.h>
#define DEC(c) (((c)-' ')&077)
main()
{
int n;
char buf[128],a,b,c,d;
scanf("begin %o ", &n);
gets(buf); /* filename */
if (!freopen(buf, "w", stdout)) /* oops.. */
{
perror(buf);
exit(1);
}
while ((n=getchar())!=EOF&&n=DEC(n))
{
while (n>0)
{
a=DEC(getchar());
b=DEC(getchar());
c=DEC(getchar());
d=DEC(getchar());
if (n-->0) putchar(a<<2|b>>4);
if (n-->0) putchar(b<<4|c>>2);
if (n-->0) putchar(c<<6|d);
}
n=getchar(); /* skip \n */
}
exit(0);
}