Ignore:
Timestamp:
Jun 9, 2016, 2:17:22 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: apply latest security patches to vendor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/lib/bitmap.c

    r917 r919  
    1919
    2020#include "includes.h"
     21#include "lib/util/bitmap.h"
    2122
    2223/* these functions provide a simple way to allocate integers from a
     
    3031        struct bitmap *bm;
    3132
    32         bm = TALLOC_P(mem_ctx, struct bitmap);
     33        bm = talloc_zero(mem_ctx, struct bitmap);
    3334
    3435        if (!bm) return NULL;
    3536
    3637        bm->n = n;
    37         bm->b = TALLOC_ZERO_ARRAY(bm, uint32, (n+31)/32);
     38        bm->b = talloc_zero_array(bm, uint32_t, (n+31)/32);
    3839        if (!bm->b) {
    3940                TALLOC_FREE(bm);
     
    5253
    5354        SMB_ASSERT(dst->b != src->b);
    54         memcpy(dst->b, src->b, sizeof(uint32)*((count+31)/32));
     55        memcpy(dst->b, src->b, sizeof(uint32_t)*((count+31)/32));
    5556
    5657        return count;
     
    6566                DEBUG(0,("Setting invalid bitmap entry %d (of %d)\n",
    6667                      i, bm->n));
    67                 return False;
     68                return false;
    6869        }
    6970        bm->b[i/32] |= (1<<(i%32));
    70         return True;
     71        return true;
    7172}
    7273
     
    7980                DEBUG(0,("clearing invalid bitmap entry %d (of %d)\n",
    8081                      i, bm->n));
    81                 return False;
     82                return false;
    8283        }
    8384        bm->b[i/32] &= ~(1<<(i%32));
    84         return True;
     85        return true;
    8586}
    8687
     
    9091bool bitmap_query(struct bitmap *bm, unsigned i)
    9192{
    92         if (i >= bm->n) return False;
     93        if (i >= bm->n) return false;
    9394        if (bm->b[i/32] & (1<<(i%32))) {
    94                 return True;
     95                return true;
    9596        }
    96         return False;
     97        return false;
    9798}
    9899
Note: See TracChangeset for help on using the changeset viewer.