diff options
Diffstat (limited to 'g10/misc.c')
-rw-r--r-- | g10/misc.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/g10/misc.c b/g10/misc.c index 5e0ba9449..eb3eceee9 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -905,15 +905,18 @@ string_to_compress_algo(const char *string) int check_compress_algo(int algo) { + switch (algo) + { + case 0: return 0; +#ifdef HAVE_ZIP + case 1: + case 2: return 0; +#endif #ifdef HAVE_BZIP2 - if(algo>=0 && algo<=3) - return 0; -#else - if(algo>=0 && algo<=2) - return 0; + case 3: return 0; #endif - - return G10ERR_COMPR_ALGO; + default: return G10ERR_COMPR_ALGO; + } } int |