1 |
nmav |
1.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 1999/12/13 21:13:16 nikos 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 |
|
|
} |