aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2014-05-12 17:05:20 +0200
committerGilles Chehade <gilles@poolp.org>2014-05-12 17:05:20 +0200
commit0962c59290029bbefa43d8700fb6f7e0042a1ca1 (patch)
tree2f20c86296887a43ec95a3a4f43bc92f6f09f7b2
parentcvsid + fix two memory leaks (diff)
downloadOpenSMTPD-opensmtpd-201405121706.tar.xz
OpenSMTPD-opensmtpd-201405121706.zip
do not int cast a sizeofopensmtpd-201405121706
-rw-r--r--smtpd/expand.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/smtpd/expand.c b/smtpd/expand.c
index 0cde969f..ca8f4e2f 100644
--- a/smtpd/expand.c
+++ b/smtpd/expand.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expand.c,v 1.26 2014/04/19 12:43:19 gilles Exp $ */
+/* $OpenBSD: expand.c,v 1.27 2014/05/09 21:30:11 tedu Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@poolp.org>
@@ -193,12 +193,14 @@ static int
expand_line_split(char **line, char **ret)
{
static char buffer[SMTPD_MAXLINESIZE];
- int esc, i, dq, sq;
+ int esc, dq, sq;
+ size_t i;
char *s;
memset(buffer, 0, sizeof buffer);
- esc = dq = sq = i = 0;
- for (s = *line; (*s) && (i < (int)sizeof(buffer)); ++s) {
+ esc = dq = sq = 0;
+ i = 0;
+ for (s = *line; (*s) && (i < sizeof(buffer)); ++s) {
if (esc) {
buffer[i++] = *s;
esc = 0;