update copyright message
[libfirm] / ir / tv / strcalc.c
index 47c9475..98e41ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -1309,8 +1309,8 @@ unsigned char sc_sub_bits(const void *value, int len, unsigned byte_ofs) {
                res |= _val(val[nibble_ofs + 1]) << 4;
 
        /* kick bits outsize */
-       if (len < (int) (8*byte_ofs)) {
-               res &= 0xFF >> (8*byte_ofs - len);
+       if (len - 8 * byte_ofs < 8) {
+               res &= (1 << (len - 8 * byte_ofs)) - 1;
        }
        return res;
 }