diff options
author | Oleg Safiullin <form@cvs.openbsd.org> | 2009-01-30 10:09:59 +0000 |
---|---|---|
committer | Oleg Safiullin <form@cvs.openbsd.org> | 2009-01-30 10:09:59 +0000 |
commit | b66a87ee9cd61ddcd5ded18d388ffd199fb3f9f4 (patch) | |
tree | 9d34184568ff3c5428a2af9c4633257b7d4368ee /usr.sbin/smtpd/parse.y | |
parent | 6d6ca00931ea3b971d2a79034896fe389d637073 (diff) |
more const -> sizeof()
no binary changes
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/parse.y')
-rw-r--r-- | usr.sbin/smtpd/parse.y | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y index 785695d5925..4c7df45705b 100644 --- a/usr.sbin/smtpd/parse.y +++ b/usr.sbin/smtpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.23 2009/01/28 21:44:15 gilles Exp $ */ +/* $OpenBSD: parse.y,v 1.24 2009/01/30 10:09:58 form Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -306,8 +306,8 @@ mapsource : DNS { map->m_src = S_DNS; } | TFILE { map->m_src = S_FILE; } | DB STRING { map->m_src = S_DB; - if (strlcpy(map->m_config, $2, MAXPATHLEN) - >= MAXPATHLEN) + if (strlcpy(map->m_config, $2, sizeof(map->m_config)) + >= sizeof(map->m_config)) err(1, "pathname too long"); } | EXTERNAL { map->m_src = S_EXT; } @@ -655,22 +655,25 @@ conditions : condition { action : DELIVER TO MAILDIR STRING { rule->r_action = A_MAILDIR; - if (strlcpy(rule->r_value.path, $4, MAXPATHLEN) - >= MAXPATHLEN) + if (strlcpy(rule->r_value.path, $4, + sizeof(rule->r_value.path)) >= + sizeof(rule->r_value.path)) fatal("pathname too long"); free($4); } | DELIVER TO MBOX STRING { rule->r_action = A_MBOX; - if (strlcpy(rule->r_value.path, $4, MAXPATHLEN) - >= MAXPATHLEN) + if (strlcpy(rule->r_value.path, $4, + sizeof(rule->r_value.path)) + >= sizeof(rule->r_value.path)) fatal("pathname too long"); free($4); } | DELIVER TO MDA STRING { rule->r_action = A_EXT; - if (strlcpy(rule->r_value.command, $4, MAXPATHLEN) - >= MAXPATHLEN) + if (strlcpy(rule->r_value.command, $4, + sizeof(rule->r_value.command)) + >= sizeof(rule->r_value.command)) fatal("command too long"); free($4); } @@ -683,8 +686,9 @@ action : DELIVER TO MAILDIR STRING { if ($3) rule->r_value.relayhost.flags = $3; - if (strlcpy(rule->r_value.relayhost.hostname, $4, MAXHOSTNAMELEN) - >= MAXHOSTNAMELEN) + if (strlcpy(rule->r_value.relayhost.hostname, $4, + sizeof(rule->r_value.relayhost.hostname)) + >= sizeof(rule->r_value.relayhost.hostname)) fatal("hostname too long"); if ($5 == 0) |