preparing for release of 2.2.3a
[Samba.git] / source / include / safe_string.h
blob2c3d2eda01fb362cd8c642c9c77e8dbc6105c23f
1 /*
2 Unix SMB/Netbios implementation.
3 Version 1.9.
4 Safe string handling routines.
5 Copyright (C) Andrew Tridgell 1994-1998
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef _SAFE_STRING_H
23 #define _SAFE_STRING_H
25 #ifdef strcpy
26 #undef strcpy
27 #endif /* strcpy */
28 #define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___;
30 #ifdef strcat
31 #undef strcat
32 #endif /* strcat */
33 #define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___;
35 #ifdef sprintf
36 #undef sprintf
37 #endif /* sprintf */
38 #define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
40 #define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
41 #define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
42 #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
43 #define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
45 #define wpstrcpy(d,s) safe_strcpy_w((d),(s),sizeof(wpstring))
46 #define wpstrcat(d,s) safe_strcat_w((d),(s),sizeof(wpstring))
47 #define wfstrcpy(d,s) safe_strcpy_w((d),(s),sizeof(wfstring))
48 #define wfstrcat(d,s) safe_strcat_w((d),(s),sizeof(wfstring))
50 #endif