fixed catching of header string

This commit is contained in:
TLINDEN
2014-02-09 15:49:52 +01:00
parent ce73950920
commit 6829ea6fbc
8 changed files with 65 additions and 63 deletions

View File

@@ -183,7 +183,7 @@ int main (int argc, char **argv) {
armor = 1;
break;
case 'Z':
armor = 1;
armor = 2;
break;
case 'b':
pbpcompat = 1;
@@ -248,8 +248,17 @@ int main (int argc, char **argv) {
if(mode == 0) {
version();
return 1;
/* turn -z|-Z into a mode if there's nothing else specified */
if(armor == 1) {
mode = PCP_MODE_ZENCODE;
}
else if(armor == 2) {
mode = PCP_MODE_ZDECODE;
}
else {
version();
return 1;
}
}
if(mode == PCP_MODE_ENCRYPT + PCP_MODE_SIGN) {

View File

@@ -117,6 +117,8 @@ int pcpz85_decode(char *infile, char *outfile) {
size_t clen;
unsigned char *decoded = pcp_z85_decode(encoded, &clen);
if(decoded == NULL)
goto errdz2;