Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
482 B

  1. #include "fmt.h"
  2. #include "textcode.h"
  3. unsigned int scan_yenc(const char *src,char *dest,unsigned int *destlen) {
  4. register const unsigned char* s=(const unsigned char*) src;
  5. unsigned long written=0,i;
  6. for (i=0; s[i]; ++i) {
  7. if (s[i]=='=') {
  8. ++i;
  9. if (s[i]=='y') break;
  10. dest[written]=s[i]-64-42;
  11. } else if (s[i]=='\n' || s[i]=='\r' || s[i]=='\0')
  12. break;
  13. else
  14. dest[written]=s[i]-42;
  15. ++written;
  16. }
  17. *destlen=written;
  18. return i;
  19. }