"Fossies" - the Fresh Open Source Software Archive

Member "libzip-1.5.2/regress/nonrandomopen.c" (12 Mar 2019, 1844 Bytes) of package /linux/misc/libzip-1.5.2.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "nonrandomopen.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.5.1_vs_1.5.2.

    1 /*
    2   nonrandomopen.c -- override zip_random
    3 
    4   Copyright (C) 2017-2018 Dieter Baron and Thomas Klausner
    5 
    6   This file is part of ckmame, a program to check rom sets for MAME.
    7   The authors can be contacted at <ckmame@nih.at>
    8 
    9   Redistribution and use in source and binary forms, with or without
   10   modification, are permitted provided that the following conditions
   11   are met:
   12   1. Redistributions of source code must retain the above copyright
   13      notice, this list of conditions and the following disclaimer.
   14   2. Redistributions in binary form must reproduce the above copyright
   15      notice, this list of conditions and the following disclaimer in
   16      the documentation and/or other materials provided with the
   17      distribution.
   18   3. The name of the author may not be used to endorse or promote
   19      products derived from this software without specific prior
   20      written permission.
   21 
   22   THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
   23   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   24   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   25   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
   26   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   27   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
   28   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   29   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
   30   IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
   31   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
   32   IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   33 */
   34 
   35 #include <string.h>
   36 
   37 #include "compat.h"
   38 
   39 #ifdef HAVE_UNISTD_H
   40 #include <unistd.h>
   41 #endif
   42 
   43 #include "zipint.h"
   44 
   45 bool
   46 zip_random(zip_uint8_t *buffer, zip_uint16_t length) {
   47     memset(buffer, 0, length);
   48 
   49     return true;
   50 }