summaryrefslogtreecommitdiff
path: root/sym.c
diff options
context:
space:
mode:
authorvern <vern>1993-11-29 16:38:31 +0000
committervern <vern>1993-11-29 16:38:31 +0000
commit7874c8e5dd33cf9b040ca5afcec83585e69f5c38 (patch)
tree627e651174e00cf92de5346b2fe93f3574c83407 /sym.c
parenta4d83480454e3a6f67b8725fe88702d8b64b1dfe (diff)
downloadflex-7874c8e5dd33cf9b040ca5afcec83585e69f5c38.tar.gz
Fixed ANSI-C glitch with '%' operator
Diffstat (limited to 'sym.c')
-rw-r--r--sym.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sym.c b/sym.c
index 3c1bb54..a512791 100644
--- a/sym.c
+++ b/sym.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /cvsroot/flex/flex/sym.c,v 2.8 1993/09/16 20:32:03 vern Exp $ */
+/* $Header: /cvsroot/flex/flex/sym.c,v 2.9 1993/11/29 16:38:31 vern Exp $ */
#include "flexdef.h"
@@ -163,8 +163,10 @@ int hash_size;
locstr = 0;
while ( str[locstr] )
- hashval = ((hashval << 1) + (unsigned char) str[locstr++]) %
- hash_size;
+ {
+ hashval = (hashval << 1) + (unsigned char) str[locstr++];
+ hashval %= hash_size;
+ }
return hashval;
}