Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sun, 08 Jul 2012 11:26:47 Commit: 469cfa6d829e92065ebcabe883f688083b61e088 https://github.com/geany/geany-plugins/commit/469cfa6d829e92065ebcabe883f688...
Log Message: ----------- GeanyPG: Fix a few integer-signedness issues
Modified Paths: -------------- geanypg/src/pinentry.c
Modified: geanypg/src/pinentry.c 13 files changed, 7 insertions(+), 6 deletions(-) =================================================================== @@ -45,17 +45,18 @@ static void geanypg_read_till(int fd, char delim) while (1) { char val; - unsigned long rv = read(fd, &val, 1); - if (!rv || val == delim) + ssize_t rv = read(fd, &val, 1); + if (rv <= 0 || val == delim) break; } }
static int geanypg_read(int fd, char delim, int max, char * buffer) { - int idx, rv = 1; + int idx; + ssize_t rv = 1; char ch = 0; - for (idx = 0; (idx < max - 1) && rv && ch != delim; ++idx) + for (idx = 0; (idx < max - 1) && rv > 0 && ch != delim; ++idx) { rv = read(fd, &ch, 1); buffer[idx] = ch; @@ -146,8 +147,8 @@ gpgme_error_t geanypg_passphrase_cb(void * hook, while (1) { char val; - register unsigned long rv = read(outpipe[READ], &val, 1); - if (!rv || val == '\n') + register ssize_t rv = read(outpipe[READ], &val, 1); + if (rv <= 0 || val == '\n') { while (!write(fd, "\n", 1)); break;
@@ Diff output truncated at 100000 characters. @@
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
plugins-commits@lists.geany.org