projects/sencrypt

changeset 4:abb770754967

Use C99-compatible version of snprintf on UnixWare 7
author Guido Berhoerster <guido+sencrypt@berhoerster.name>
date Sun Apr 13 00:04:04 2014 +0200 (2014-04-13)
parents f230c550e261
children 5cc938aff9ab
files compat.h sencrypt.c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/compat.h	Sun Apr 13 00:04:04 2014 +0200
     1.3 @@ -0,0 +1,35 @@
     1.4 +/*
     1.5 + * Copyright (C) 2014 Guido Berhoerster <guido+sencrypt@berhoerster.name>
     1.6 + *
     1.7 + * Permission is hereby granted, free of charge, to any person obtaining
     1.8 + * a copy of this software and associated documentation files (the
     1.9 + * "Software"), to deal in the Software without restriction, including
    1.10 + * without limitation the rights to use, copy, modify, merge, publish,
    1.11 + * distribute, sublicense, and/or sell copies of the Software, and to
    1.12 + * permit persons to whom the Software is furnished to do so, subject to
    1.13 + * the following conditions:
    1.14 + *
    1.15 + * The above copyright notice and this permission notice shall be included
    1.16 + * in all copies or substantial portions of the Software.
    1.17 + *
    1.18 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    1.19 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    1.20 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    1.21 + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    1.22 + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    1.23 + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    1.24 + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    1.25 + */
    1.26 +
    1.27 +#ifndef	COMPAT_H
    1.28 +#define	COMPAT_H
    1.29 +
    1.30 +/*
    1.31 + * select C99/POSIX:2004-compatible versions of vsnprintf/snprintf on UnixWare 7
    1.32 + */
    1.33 +#if defined(__SCO_VERSION__) && !defined(__OPENSERVER__)
    1.34 +#define	vsnprintf	_xvsnprintf
    1.35 +#define	snprintf	_xsnprintf
    1.36 +#endif /* defined(__SCO_VERSION__) && !defined(__OPENSERVER__) */
    1.37 +
    1.38 +#endif /* COMPAT_H */
     2.1 --- a/sencrypt.c	Thu Apr 10 00:05:56 2014 +0200
     2.2 +++ b/sencrypt.c	Sun Apr 13 00:04:04 2014 +0200
     2.3 @@ -42,6 +42,7 @@
     2.4  #else
     2.5  #include "err.h"
     2.6  #endif /* HAVE_ERR_H */
     2.7 +#include "compat.h"
     2.8  
     2.9  #define	MAX(a, b)	(((a) > (b)) ? (a) : (b))
    2.10