File:  [PGP] / pgp / src / zip.c
Revision 1.1.1.7 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:45:21 2018 UTC (8 years, 1 month ago) by root
Branches: phill, MAIN
CVS tags: pgp263i, HEAD
PGP 2.6.3i

/* Support code for the zip/unzip code - just handles error messages.  To
   get exact errors, define ZIPDEBUG */

#include <stdio.h>
#include <stdlib.h>
#include "usuals.h"
#include "fileio.h"
#include "language.h"
#include "pgp.h"
#include "exitpgp.h"
#include "zip.h"

#include "ziperr.h" /* for ZE_MEM (and errors[] if ZIPDEBUG defined) */

/* Clean error exit: c is a ZE_-class error, *msg is an error message.
   Issue a message for the error, clean up files and memory, and exit */

void err(int c, char *msg)
{

#ifdef ZIPDEBUG
	if (PERR(c))
		perror("zip error");
	fprintf(stderr, "zip error: %s (%s)\n", errors[c-1], msg);
#endif /* ZIPDEBUG */

	/* Complain and return and out of memory error code */
	if(c==ZE_MEM) {
		fprintf( stderr, LANG("\nOut of memory\n") );
		exitPGP( 7 );
	} else {
		fprintf(stderr,LANG("\nCompression/decompression error\n") );
		/* Yuck */
		exitPGP( 23 );
	}
}

/* Internal error, should never happen */

void error(char *msg)
{
	err(-1, msg);
}

unix.superglobalmegacorp.com

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