]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - attribute.c
attribute: Avoid shifting 32 bit integers.
[paraslash.git] / attribute.c
index 5672309ada3b65dfadad0f1a3ba7f4881e52740c..65f08aef4c062c79b6b204b628fe0bbf0c98e8bb 100644 (file)
@@ -222,7 +222,7 @@ int com_lsatt(struct command_context *cc)
 static void com_setatt_callback(__a_unused int fd, const struct osl_object *query)
 {
        char *p;
-       uint64_t add_mask = 0, del_mask = 0;
+       uint64_t add_mask = 0, del_mask = 0, one = 1;
        int ret;
        size_t len;
        struct osl_object obj;
@@ -249,9 +249,9 @@ static void com_setatt_callback(__a_unused int fd, const struct osl_object *quer
                if (ret < 0)
                        goto out;
                if (c == '+')
-                       add_mask |= (1UL << *(unsigned char *)obj.data);
+                       add_mask |= (one << *(unsigned char *)obj.data);
                else
-                       del_mask |= (1UL << *(unsigned char *)obj.data);
+                       del_mask |= (one << *(unsigned char *)obj.data);
        }
        ret = -E_ATTR_SYNTAX;
        if (!add_mask && !del_mask)