Changeset 5442:cc2334fdf126
- Timestamp:
- 2008-07-02 01:06:10 (5 months ago)
- Author:
- Rocco Rutte <pdmef@…>
- Branch:
- HEAD
- Message:
-
Use casts to avoid triggering integer overflow detection in hash function
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r4640
|
r5442
|
|
| 31 | 31 | int hash_string (const unsigned char *s, int n) |
| 32 | 32 | { |
| 33 | | int h = 0; |
| | 33 | unsigned int h = 0; |
| 34 | 34 | |
| 35 | 35 | #if 0 |
| … |
… |
|
| 43 | 43 | #endif |
| 44 | 44 | |
| 45 | | return (h % n); |
| | 45 | return (signed) (h % n); |
| 46 | 46 | } |
| 47 | 47 | |