[balsa/gtk3] Reduce scope and suppress incorrect cppcheck error
- From: Peter Bloomfield <PeterB src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Reduce scope and suppress incorrect cppcheck error
- Date: Sun, 22 Jul 2012 19:42:41 +0000 (UTC)
commit 5f26a90dcc15b3d0a8ac4a86bc20f2cac3c1f727
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sun Jul 22 15:03:55 2012 -0400
Reduce scope and suppress incorrect cppcheck error
* libbalsa/imap-server.c (libbalsa_imap_server_get_handle,
libbalsa_imap_server_get_handle_with_user): reduce scope of
variables; suppress incorrect null pointer error.
ChangeLog | 6 ++++++
libbalsa/imap-server.c | 7 +++++--
2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bb139e9..3dc975a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2012-07-22 Peter Bloomfield
+ * libbalsa/imap-server.c (libbalsa_imap_server_get_handle,
+ libbalsa_imap_server_get_handle_with_user): reduce scope of
+ variables; suppress incorrect null pointer error.
+
+2012-07-22 Peter Bloomfield
+
* libbalsa/gmime-multipart-crypt.c (sign_prepare): reduce scope.
2012-07-22 Peter Bloomfield
diff --git a/libbalsa/imap-server.c b/libbalsa/imap-server.c
index bb82be4..40786f5 100644
--- a/libbalsa/imap-server.c
+++ b/libbalsa/imap-server.c
@@ -675,7 +675,6 @@ libbalsa_imap_server_get_handle(LibBalsaImapServer *imap_server, GError **err)
{
LibBalsaServer *server = LIBBALSA_SERVER(imap_server);
struct handle_info *info = NULL;
- ImapResult rc;
if (!imap_server || imap_server->offline_mode)
return NULL;
@@ -710,6 +709,8 @@ libbalsa_imap_server_get_handle(LibBalsaImapServer *imap_server, GError **err)
}
if (info) {
if(imap_mbox_is_disconnected(info->handle)) {
+ ImapResult rc;
+
rc=imap_mbox_handle_connect(info->handle, server->host,
REQ_SSL(server));
if(rc != IMAP_SUCCESS) {
@@ -725,6 +726,7 @@ libbalsa_imap_server_get_handle(LibBalsaImapServer *imap_server, GError **err)
}
UNLOCK_SERVER(imap_server);
+ /* cppcheck-suppress nullPointer */
return info ? info->handle : NULL;
}
@@ -748,7 +750,6 @@ libbalsa_imap_server_get_handle_with_user(LibBalsaImapServer *imap_server,
{
LibBalsaServer *server = LIBBALSA_SERVER(imap_server);
struct handle_info *info = NULL;
- ImapResult rc;
if (imap_server->offline_mode)
return NULL;
@@ -806,6 +807,8 @@ libbalsa_imap_server_get_handle_with_user(LibBalsaImapServer *imap_server,
}
if (imap_mbox_is_disconnected(info->handle)) {
+ ImapResult rc;
+
rc=imap_mbox_handle_connect(info->handle, server->host,
REQ_SSL(server));
if(rc != IMAP_SUCCESS) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]