"Fossies" - the Fresh Open Source Software Archive

Member "libmcrypt-2.5.8/lib/bzero.c" (9 Mar 2002, 1166 Bytes) of package /linux/privat/old/libmcrypt-2.5.8.tar.gz:


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 "bzero.c" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) 1998,1999 Nikos Mavroyanopoulos
    3  *
    4  * This library is free software; you can redistribute it and/or
    5  * modify it under the terms of the GNU Library General Public
    6  * License as published by the Free Software Foundation; either
    7  * version 2 of the License, or (at your option) any later version.
    8  *
    9  * This library is distributed in the hope that it will be useful,
   10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   12  * Library General Public License for more details.
   13  *
   14  * You should have received a copy of the GNU Library General Public
   15  * License along with this library; if not, write to the
   16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   17  * Boston, MA 02111-1307, USA.
   18  */
   19 
   20 /* $Id: bzero.c,v 1.1.1.1 2000/05/22 13:07:51 nmav Exp $ */
   21 
   22 #ifndef LIBDEFS_H
   23 # define LIBDEFS_H
   24 # include <libdefs.h>
   25 #endif
   26 
   27 void Bzero(void *s, size_t n)
   28 {
   29 #ifdef HAVE_MEMSET
   30     memset( (void*) s, '\0', (size_t) n);
   31 #else
   32 # ifdef HAVE_BZERO
   33     bzero( (void*) s, (size_t) n);
   34 # else
   35     char *stmp = s;
   36 
   37     for (int i = 0; i < n; i++)
   38         stmp[i] = '\0';
   39 
   40 # endif
   41 #endif
   42 }