Annotation of pgp/src/zip.c, revision 1.1.1.3

1.1.1.2   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"
1.1.1.3 ! root       10: #include "exitpgp.h"
1.1.1.2   root       11: 
1.1.1.3 ! root       12: #include "ziperr.h" /* for ZE_MEM (and errors[] if ZIPDEBUG defined) */
1.1.1.2   root       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, PSTR("\nOut of memory\n") );
                     29:                exitPGP( 7 );
                     30:        }
                     31:        else
                     32:        {       fprintf( stderr, PSTR("\nCompression/decompression error\n") ); /* Yuck */
                     33:                exitPGP( 23 );
                     34:        }
                     35:        }
                     36: 
                     37: /* Internal error, should never happen */
                     38: 
                     39: void error(char *msg)
                     40:        {
                     41:        err(-1, msg);
                     42:        }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.