dovecot: Renamed strocpy() to i_strocpy().

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 16 13:53:23 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/18173a52f721
changeset: 6422:18173a52f721
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Sep 16 13:30:31 2007 +0300
description:
Renamed strocpy() to i_strocpy().

diffstat:

12 files changed, 14 insertions(+), 14 deletions(-)
src/auth/password-scheme-otp.c                 |    2 +-
src/imap/main.c                                |    2 +-
src/lib-storage/index/mbox/mbox-save.c         |    2 +-
src/lib-storage/list/mailbox-list-fs-iter.c    |    2 +-
src/lib/hostpid.c                              |    4 ++--
src/lib/network.c                              |    4 ++--
src/lib/process-title.c                        |    2 +-
src/lib/strfuncs.c                             |    2 +-
src/lib/strfuncs.h                             |    2 +-
src/login-common/ssl-proxy-openssl.c           |    2 +-
src/plugins/lazy-expunge/lazy-expunge-plugin.c |    2 +-
src/pop3/main.c                                |    2 +-

diffs (161 lines):

diff -r 6fdc552c24de -r 18173a52f721 src/auth/password-scheme-otp.c
--- a/src/auth/password-scheme-otp.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/auth/password-scheme-otp.c	Sun Sep 16 13:30:31 2007 +0300
@@ -27,7 +27,7 @@ const char *password_generate_otp(const 
 		unsigned char random_data[OTP_MAX_SEED_LEN / 2];
 
 		random_fill(random_data, sizeof(random_data));
-		strocpy(state.seed, binary_to_hex(random_data,
+		i_strocpy(state.seed, binary_to_hex(random_data,
 			OTP_MAX_SEED_LEN / 2), sizeof(state.seed));
 
 		state.seq = 1024;
diff -r 6fdc552c24de -r 18173a52f721 src/imap/main.c
--- a/src/imap/main.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/imap/main.c	Sun Sep 16 13:30:31 2007 +0300
@@ -98,7 +98,7 @@ static void open_logfile(void)
 	}
 
 	if (getenv("LOG_PREFIX") != NULL)
-		strocpy(log_prefix, getenv("LOG_PREFIX"), sizeof(log_prefix));
+		i_strocpy(log_prefix, getenv("LOG_PREFIX"), sizeof(log_prefix));
 	else {
 		user = getenv("USER");
 		if (user == NULL) {
diff -r 6fdc552c24de -r 18173a52f721 src/lib-storage/index/mbox/mbox-save.c
--- a/src/lib-storage/index/mbox/mbox-save.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/lib-storage/index/mbox/mbox-save.c	Sun Sep 16 13:30:31 2007 +0300
@@ -128,7 +128,7 @@ static int write_from_line(struct mbox_s
 			name = my_hostname;
 		}
 
-		strocpy(my_hostdomain, name, sizeof(my_hostdomain));
+		i_strocpy(my_hostdomain, name, sizeof(my_hostdomain));
 	}
 
 	t_push();
diff -r 6fdc552c24de -r 18173a52f721 src/lib-storage/list/mailbox-list-fs-iter.c
--- a/src/lib-storage/list/mailbox-list-fs-iter.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/lib-storage/list/mailbox-list-fs-iter.c	Sun Sep 16 13:30:31 2007 +0300
@@ -521,7 +521,7 @@ static struct dirent *fs_list_dir_next(s
 		else
 			dir->dirent.d_type = DT_UNKNOWN;
 #endif
-		if (strocpy(dir->dirent.d_name, fname,
+		if (i_strocpy(dir->dirent.d_name, fname,
 			    sizeof(dir->dirent.d_name)) < 0) {
 			/* name too large.. shouldn't happen. */
 			continue;
diff -r 6fdc552c24de -r 18173a52f721 src/lib/hostpid.c
--- a/src/lib/hostpid.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/lib/hostpid.c	Sun Sep 16 13:30:31 2007 +0300
@@ -14,14 +14,14 @@ void hostpid_init(void)
 
 	if (my_hostname == NULL) {
 		if (gethostname(hostname, sizeof(hostname)-1) == -1)
-			strocpy(hostname, "unknown", sizeof(hostname));
+			i_strocpy(hostname, "unknown", sizeof(hostname));
 		hostname[sizeof(hostname)-1] = '\0';
 
 		my_hostname = hostname;
 	}
 
 	if (my_pid == NULL) {
-		strocpy(pid, dec2str(getpid()), sizeof(pid));
+		i_strocpy(pid, dec2str(getpid()), sizeof(pid));
 		my_pid = pid;
 	}
 }
diff -r 6fdc552c24de -r 18173a52f721 src/lib/network.c
--- a/src/lib/network.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/lib/network.c	Sun Sep 16 13:30:31 2007 +0300
@@ -194,7 +194,7 @@ int net_connect_unix(const char *path)
 
 	memset(&sa, 0, sizeof(sa));
 	sa.un.sun_family = AF_UNIX;
-	if (strocpy(sa.un.sun_path, path, sizeof(sa.un.sun_path)) < 0) {
+	if (i_strocpy(sa.un.sun_path, path, sizeof(sa.un.sun_path)) < 0) {
 		/* too long path */
 		errno = EINVAL;
 		return -1;
@@ -334,7 +334,7 @@ int net_listen_unix(const char *path, in
 
 	memset(&sa, 0, sizeof(sa));
 	sa.un.sun_family = AF_UNIX;
-	if (strocpy(sa.un.sun_path, path, sizeof(sa.un.sun_path)) < 0) {
+	if (i_strocpy(sa.un.sun_path, path, sizeof(sa.un.sun_path)) < 0) {
 		/* too long path */
 		errno = EINVAL;
 		return -1;
diff -r 6fdc552c24de -r 18173a52f721 src/lib/process-title.c
--- a/src/lib/process-title.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/lib/process-title.c	Sun Sep 16 13:30:31 2007 +0300
@@ -50,7 +50,7 @@ static void linux_proctitle_init(char *a
 
 static void linux_proctitle_set(const char *title)
 {
-	strocpy(process_title, title, process_title_len);
+	i_strocpy(process_title, title, process_title_len);
 }
 
 #endif
diff -r 6fdc552c24de -r 18173a52f721 src/lib/strfuncs.c
--- a/src/lib/strfuncs.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/lib/strfuncs.c	Sun Sep 16 13:30:31 2007 +0300
@@ -298,7 +298,7 @@ bool is_numeric(const char *str, char en
 	return TRUE;
 }
 
-int strocpy(char *dest, const char *src, size_t dstsize)
+int i_strocpy(char *dest, const char *src, size_t dstsize)
 {
 	if (dstsize == 0)
 		return -1;
diff -r 6fdc552c24de -r 18173a52f721 src/lib/strfuncs.h
--- a/src/lib/strfuncs.h	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/lib/strfuncs.h	Sun Sep 16 13:30:31 2007 +0300
@@ -44,7 +44,7 @@ bool is_numeric(const char *str, char en
 bool is_numeric(const char *str, char end_char);
 
 /* Like strlcpy(), but return -1 if buffer was overflown, 0 if not. */
-int strocpy(char *dest, const char *src, size_t dstsize);
+int i_strocpy(char *dest, const char *src, size_t dstsize);
 
 /* Print given directory and file to dest buffer, separated with '/'.
    If destination buffer is too small, it's set to empty string and errno is
diff -r 6fdc552c24de -r 18173a52f721 src/login-common/ssl-proxy-openssl.c
--- a/src/login-common/ssl-proxy-openssl.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/login-common/ssl-proxy-openssl.c	Sun Sep 16 13:30:31 2007 +0300
@@ -654,7 +654,7 @@ pem_password_callback(char *buf, int siz
 		return 0;
 	}
 
-	if (strocpy(buf, userdata, size) < 0)
+	if (i_strocpy(buf, userdata, size) < 0)
 		return 0;
 	return strlen(buf);
 }
diff -r 6fdc552c24de -r 18173a52f721 src/plugins/lazy-expunge/lazy-expunge-plugin.c
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Sun Sep 16 13:30:31 2007 +0300
@@ -449,7 +449,7 @@ lazy_expunge_mailbox_list_delete(struct 
 	/* destination mailbox name needs to contain a timestamp */
 	tm = localtime(&ioloop_time);
 	if (strftime(timestamp, sizeof(timestamp), "%Y%m%d-%H%M%S", tm) == 0)
-		strocpy(timestamp, dec2str(ioloop_time), sizeof(timestamp));
+		i_strocpy(timestamp, dec2str(ioloop_time), sizeof(timestamp));
 	destname = t_strconcat(name, "-", timestamp, NULL);
 
 	/* first move the actual mailbox */
diff -r 6fdc552c24de -r 18173a52f721 src/pop3/main.c
--- a/src/pop3/main.c	Sun Sep 16 13:26:07 2007 +0300
+++ b/src/pop3/main.c	Sun Sep 16 13:30:31 2007 +0300
@@ -122,7 +122,7 @@ static void open_logfile(void)
 	}
 
 	if (getenv("LOG_PREFIX") != NULL)
-		strocpy(log_prefix, getenv("LOG_PREFIX"), sizeof(log_prefix));
+		i_strocpy(log_prefix, getenv("LOG_PREFIX"), sizeof(log_prefix));
 	else {
 		user = getenv("USER");
 		if (user == NULL) user = "??";


More information about the dovecot-cvs mailing list