DGtal 1.3.0
Loading...
Searching...
No Matches
Tools.ih
1/* -*- mode: c++ -*- */
2/**
3 * @file Tools.ih
4 * @author Sebastien Fourey <http://www.greyc.ensicaen.fr/~seb>
5 * @date June 2010
6 *
7 * @brief Tools (def. of inline functions and methods)
8 */
9/*
10 * \@copyright This File is part of the Board library which is
11 * licensed under the terms of the GNU Lesser General Public Licence.
12 * See the LICENCE file for further details.
13 */
14
15namespace LibBoard {
16
17 void secured_strncpy( char * dst, const char * src, size_t count )
18{
19#if defined( _MSC_VER )
20 strncpy_s( dst, count, src, _TRUNCATE );
21#else
22 strncpy( dst, src, count );
23#endif // defined( _MSC_VER )
24}
25
26void secured_ctime( char * str, const time_t * t, size_t count )
27{
28#if defined( _MSC_VER )
29 ctime_s( str, count, t );
30#else
31 strncpy( str, ctime(t), count );
32#endif // defined( _MSC_VER )
33}
34
35
36
37} // namespace LibBoard