All pastes #549817 Raw Edit

duff's cowfiller

public c v1 · immutable
·published 2007-06-08 07:13 UTC
rendered paste body
void cowfill( unsigned char *buffer, size_t length ){    unsigned char *ptr = buffer + length - 1;    if ( ! length ) {        return;    }    switch ( length % 4 ) {        while ( ptr >= buffer ) {        case 0:            *ptr-- = 0xEF;        case 3:            *ptr-- = 0xBE;        case 2:            *ptr-- = 0xAD;        case 1:            *ptr-- = 0xDE;        }    }}