00001 /* 00002 ** Copyright(C) 2006 INL 00003 ** Written by Victor Stinner <haypo@inl.fr> 00004 ** INL http://www.inl.fr/ 00005 ** 00006 ** $Id: security.h 4847 2008-06-13 14:48:31Z regit $ 00007 ** 00008 ** This program is free software; you can redistribute it and/or modify 00009 ** it under the terms of the GNU General Public License as published by 00010 ** the Free Software Foundation, version 3 of the License. 00011 ** 00012 ** This program is distributed in the hope that it will be useful, 00013 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 ** GNU General Public License for more details. 00016 ** 00017 ** You should have received a copy of the GNU General Public License 00018 ** along with this program; if not, write to the Free Software 00019 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00020 */ 00021 00022 00023 #ifndef _NUFW_SECURITY_H 00024 #define _NUFW_SECURITY_H 00025 00034 #define SECURE_STRNCPY(dst, src, size) \ 00035 do { strncpy(dst, src, (size)-1); (dst)[(size)-1] = '\0'; } while (0) 00036 00045 #define SECURE_STRNCAT(dst, src, size) \ 00046 do { strncat(dst, src, (size)-1); (dst)[(size)-1] = '\0'; } while (0) 00047 00048 #endif /* of ifndef _NUFW_SECURITY_H */
1.4.7