summaryrefslogtreecommitdiffstats
path: root/libkpgp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-21 13:17:48 -0600
committerSlávek Banko <slavek.banko@axis.cz>2012-06-03 04:25:16 +0200
commitc34a46b466d8b30bc5490c64a5c77f5bf6f0b6c4 (patch)
tree1b245a0731c22ee39e8da4b1fe4d5795281fc99c /libkpgp
parent6d45b35a4abcf3cab08b6d99e3cde8ad8da820f8 (diff)
downloadtdepim-c34a46b466d8b30bc5490c64a5c77f5bf6f0b6c4.tar.gz
tdepim-c34a46b466d8b30bc5490c64a5c77f5bf6f0b6c4.zip
Fix a number of build warnings
(cherry picked from commit 292e3c830032a4634f04c3095d6bfa272b65d712)
Diffstat (limited to 'libkpgp')
-rw-r--r--libkpgp/kpgpbase.cpp63
-rw-r--r--libkpgp/kpgpbase2.cpp4
2 files changed, 54 insertions, 13 deletions
diff --git a/libkpgp/kpgpbase.cpp b/libkpgp/kpgpbase.cpp
index 591a99439..c8efdfa4a 100644
--- a/libkpgp/kpgpbase.cpp
+++ b/libkpgp/kpgpbase.cpp
@@ -76,7 +76,11 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
if(passphrase)
{
- pipe(ppass);
+ if (pipe(ppass) < 0) {
+ // An error occurred
+ // FIXME
+ printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
+ }
pass = fdopen(ppass[1], "w");
fwrite(passphrase, sizeof(char), strlen(passphrase), pass);
@@ -104,9 +108,21 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
error = "";
output = "";
- pipe(pin);
- pipe(pout);
- pipe(perr);
+ if (pipe(pin) < 0) {
+ // An error occurred
+ // FIXME
+ printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
+ }
+ if (pipe(pout) < 0) {
+ // An error occurred
+ // FIXME
+ printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
+ }
+ if (pipe(perr) < 0) {
+ // An error occurred
+ // FIXME
+ printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
+ }
TQApplication::flushX();
if(!(child_pid = fork()))
@@ -241,8 +257,13 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
}
}
}
- else // if input.isEmpty()
- write(pin[1], "\n", 1);
+ else { // if input.isEmpty()
+ if (write(pin[1], "\n", 1) < 0) {
+ // An error occurred
+ // FIXME
+ printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
+ }
+ }
//kdDebug(5100) << "All input was written to pin[1]" << endl;
}
close(pin[1]);
@@ -398,7 +419,11 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
if(passphrase)
{
- pipe(ppass);
+ if (pipe(ppass) < 0) {
+ // An error occurred
+ // FIXME
+ printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
+ }
pass = fdopen(ppass[1], "w");
fwrite(passphrase, sizeof(char), strlen(passphrase), pass);
@@ -418,9 +443,21 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
error = "";
output = "";
- pipe(pin);
- pipe(pout);
- pipe(perr);
+ if (pipe(pin) < 0) {
+ // An error occurred
+ // FIXME
+ printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
+ }
+ if (pipe(pout) < 0) {
+ // An error occurred
+ // FIXME
+ printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
+ }
+ if (pipe(perr) < 0) {
+ // An error occurred
+ // FIXME
+ printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
+ }
if( passphrase ) {
if( mVersion >= "1.0.7" ) {
@@ -617,7 +654,11 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
}
}
else { // if input.isEmpty()
- write(pin[1], "\n", 1);
+ if (write(pin[1], "\n", 1) < 0) {
+ // An error occurred
+ // FIXME
+ printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
+ }
//kdDebug(5100) << "All input was written to pin[1]" << endl;
close (pin[1]);
pin[1] = -1;
diff --git a/libkpgp/kpgpbase2.cpp b/libkpgp/kpgpbase2.cpp
index fdafa130e..9427edaf0 100644
--- a/libkpgp/kpgpbase2.cpp
+++ b/libkpgp/kpgpbase2.cpp
@@ -1031,8 +1031,8 @@ Base2::parseKeyList( const TQCString& output, bool secretKeys )
// Example:
// Key fingerprint = 47 30 7C 76 05 BF 5E FB 72 41 00 F2 7D 0B D0 49
- int pos2;
- pos2 = pos + 18;
+// int pos2;
+// pos2 = pos + 18;
TQCString fingerprint = output.mid( pos, index2-pos );
// remove white space from the fingerprint
for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; )