dovecot-2.2: various - trivial NULL-related sparse cleanups

dovecot at dovecot.org dovecot at dovecot.org
Tue May 27 18:19:09 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/552cab8feb5f
changeset: 17398:552cab8feb5f
user:      Phil Carmody <phil at dovecot.fi>
date:      Tue May 27 21:17:34 2014 +0300
description:
various - trivial NULL-related sparse cleanups
These zero-alikes are all pointers, so should explicitly be NULL.

Signed-off-by: Phil Carmody <phil at dovecot.fi>

diffstat:

 src/config/sysinfo-get.c             |  4 ++--
 src/director/user-directory.c        |  2 +-
 src/doveadm/doveadm-mail.c           |  2 +-
 src/imap/imap-sync.c                 |  2 +-
 src/lib-http/http-transfer-chunked.c |  2 +-
 src/lib-sql/driver-sqlite.c          |  2 +-
 src/util/script-login.c              |  2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diffs (89 lines):

diff -r f373df52082a -r 552cab8feb5f src/config/sysinfo-get.c
--- a/src/config/sysinfo-get.c	Tue May 27 21:17:34 2014 +0300
+++ b/src/config/sysinfo-get.c	Tue May 27 21:17:34 2014 +0300
@@ -36,11 +36,11 @@
 	if (!readfile(path, &data))
 		return FALSE;
 
-	for (p = t_strsplit(data, "\n"); *p != '\0'; p++) {
+	for (p = t_strsplit(data, "\n"); *p != NULL; p++) {
 		if (strncmp(*p, "DISTRIB_DESCRIPTION=", 20) == 0)
 			break;
 	}
-	if (*p == '\0')
+	if (*p == NULL)
 		return FALSE;
 
 	str = t_strcut(*p + 20, '\n');
diff -r f373df52082a -r 552cab8feb5f src/director/user-directory.c
--- a/src/director/user-directory.c	Tue May 27 21:17:34 2014 +0300
+++ b/src/director/user-directory.c	Tue May 27 21:17:34 2014 +0300
@@ -328,7 +328,7 @@
 
 	user = iter->pos;
 	if (user == NULL)
-		return FALSE;
+		return NULL;
 
 	iter->pos = user->next;
 	return user;
diff -r f373df52082a -r 552cab8feb5f src/doveadm/doveadm-mail.c
--- a/src/doveadm/doveadm-mail.c	Tue May 27 21:17:34 2014 +0300
+++ b/src/doveadm/doveadm-mail.c	Tue May 27 21:17:34 2014 +0300
@@ -604,7 +604,7 @@
 		}
 	}
 
-	return FALSE;
+	return NULL;
 }
 
 bool doveadm_mail_try_run(const char *cmd_name, int argc, char *argv[])
diff -r f373df52082a -r 552cab8feb5f src/imap/imap-sync.c
--- a/src/imap/imap-sync.c	Tue May 27 21:17:34 2014 +0300
+++ b/src/imap/imap-sync.c	Tue May 27 21:17:34 2014 +0300
@@ -229,7 +229,7 @@
 
 	ctx->sync_ctx = mailbox_sync_init(box, flags);
 	ctx->t = mailbox_transaction_begin(box, 0);
-	ctx->mail = mail_alloc(ctx->t, MAIL_FETCH_FLAGS, 0);
+	ctx->mail = mail_alloc(ctx->t, MAIL_FETCH_FLAGS, NULL);
 	ctx->messages_count = client->messages_count;
 	i_array_init(&ctx->tmp_keywords, client->keywords.announce_count + 8);
 
diff -r f373df52082a -r 552cab8feb5f src/lib-http/http-transfer-chunked.c
--- a/src/lib-http/http-transfer-chunked.c	Tue May 27 21:17:34 2014 +0300
+++ b/src/lib-http/http-transfer-chunked.c	Tue May 27 21:17:34 2014 +0300
@@ -437,7 +437,7 @@
 		/* NOTE: trailer is currently ignored */
 		/* FIXME: limit trailer size */
 		tcstream->header_parser =
-			http_header_parser_init(tcstream->istream.parent, 0, TRUE);
+			http_header_parser_init(tcstream->istream.parent, NULL, TRUE);
 	}
 
 	while ((ret=http_header_parse_next_field(tcstream->header_parser,
diff -r f373df52082a -r 552cab8feb5f src/lib-sql/driver-sqlite.c
--- a/src/lib-sql/driver-sqlite.c	Tue May 27 21:17:34 2014 +0300
+++ b/src/lib-sql/driver-sqlite.c	Tue May 27 21:17:34 2014 +0300
@@ -133,7 +133,7 @@
 	if (driver_sqlite_connect(_db) < 0)
 		return;
 
-	db->rc = sqlite3_exec(db->sqlite, query, NULL, 0, NULL);
+	db->rc = sqlite3_exec(db->sqlite, query, NULL, NULL, NULL);
 	if (db->rc != SQLITE_OK) {
 		i_error("sqlite: exec(%s) failed: %s (%d)",
 			query, sqlite3_errmsg(db->sqlite), db->rc);
diff -r f373df52082a -r 552cab8feb5f src/util/script-login.c
--- a/src/util/script-login.c	Tue May 27 21:17:34 2014 +0300
+++ b/src/util/script-login.c	Tue May 27 21:17:34 2014 +0300
@@ -102,7 +102,7 @@
 	env_put(t_strconcat("IP=", net_ip2addr(&input.remote_ip), NULL));
 	env_put(t_strconcat("USER=", input.username, NULL));
 
-	for (; args[i] != '\0'; i++) {
+	for (; args[i] != NULL; i++) {
 		args[i] = str_tabunescape(t_strdup_noconst(args[i]));
 		value = strchr(args[i], '=');
 		if (value != NULL) {


More information about the dovecot-cvs mailing list