|
|
1.1.1.4 ! root 1: /* Support code for the zip/unzip code - just handles error messages. To ! 2: get exact errors, define ZIPDEBUG */ ! 3: ! 4: #include <stdio.h> ! 5: #include <stdlib.h> ! 6: #include "usuals.h" ! 7: #include "fileio.h" ! 8: #include "language.h" ! 9: #include "pgp.h" ! 10: #include "exitpgp.h" ! 11: ! 12: #include "ziperr.h" /* for ZE_MEM (and errors[] if ZIPDEBUG defined) */ ! 13: ! 14: /* Clean error exit: c is a ZE_-class error, *msg is an error message. ! 15: Issue a message for the error, clean up files and memory, and exit */ ! 16: ! 17: void err(int c, char *msg) ! 18: { ! 19: ! 20: #ifdef ZIPDEBUG ! 21: if (PERR(c)) ! 22: perror("zip error"); ! 23: fprintf(stderr, "zip error: %s (%s)\n", errors[c-1], msg); ! 24: #endif /* ZIPDEBUG */ ! 25: ! 26: /* Complain and return and out of memory error code */ ! 27: if(c==ZE_MEM) { ! 28: fprintf( stderr, LANG("\nOut of memory\n") ); ! 29: exitPGP( 7 ); ! 30: } else { ! 31: fprintf( stderr, LANG("\nCompression/decompression error\n") ); /* Yuck */ ! 32: exitPGP( 23 ); ! 33: } ! 34: } ! 35: ! 36: /* Internal error, should never happen */ ! 37: ! 38: void error(char *msg) ! 39: { ! 40: err(-1, msg); ! 41: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.