diff options
author | Camiel Dobbelaar <camield@cvs.openbsd.org> | 2002-11-19 12:11:37 +0000 |
---|---|---|
committer | Camiel Dobbelaar <camield@cvs.openbsd.org> | 2002-11-19 12:11:37 +0000 |
commit | 706f51cf868a0efa14a3dba30bdb8bc4b49802e7 (patch) | |
tree | b97a6f7cdb9cf082a6ae207c5223f830f79853fa | |
parent | ff3699e7ba2c88c502a8b08ae555e6a51fa53f0a (diff) |
- match 'Gb' case-sensitively
- match "%" unit only, not "%crap"
ok henning@
-rw-r--r-- | sbin/pfctl/parse.y | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index de57a541d1b..fbce8cbd683 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.193 2002/11/19 11:25:45 wilfried Exp $ */ +/* $OpenBSD: parse.y,v 1.194 2002/11/19 12:11:36 camield Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -608,15 +608,15 @@ bandwidth : /* empty */ { bps = strtod($2, &cp); if (cp != NULL) { - if (!strcmp(cp, "b")) { - /* nothing */ - } else if (!strcmp(cp, "Kb")) + if (!strcmp(cp, "b")) + ; + else if (!strcmp(cp, "Kb")) bps *= 1024; else if (!strcmp(cp, "Mb")) bps *= 1024 * 1024; - else if (!strcasecmp(cp, "Gb")) + else if (!strcmp(cp, "Gb")) bps *= 1024 * 1024 * 1024; - else if (*cp == '%') { + else if (!strcmp(cp, "%")) { if (bps < 0 || bps > 100) { yyerror("bandwidth spec " "out of range"); |