X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=include%2Fnc_string.h;h=7e6ccd410cbfe305eb8dfdc8d05b76eb9d1eba7e;hp=c087a82fb1d8addd3e8f131af0938a460867c5fa;hb=89ca7974b018d46049b6eaf1b7f17784e3a001d1;hpb=8b06e371ed1bce3dd6f37138e6becb5e1a562fe0 diff --git a/include/nc_string.h b/include/nc_string.h index c087a82f..7e6ccd41 100644 --- a/include/nc_string.h +++ b/include/nc_string.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2012 Free Software Foundation, Inc. * + * Copyright (c) 2012,2013 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,7 +36,7 @@ #include /* - * $Id: nc_string.h,v 1.3 2012/02/23 10:21:17 tom Exp $ + * $Id: nc_string.h,v 1.4 2013/12/15 01:09:19 tom Exp $ * * String-hacks. Use these macros to stifle warnings on (presumably) correct * uses of strcat, strcpy and sprintf. @@ -49,26 +49,26 @@ */ #ifdef __cplusplus -#define NCURSES_VOID /* nothing */ +#define NCURSES_VOID /* nothing */ #else #define NCURSES_VOID (void) #endif #if USE_STRING_HACKS && HAVE_STRLCAT -#define _nc_STRCAT(d,s,n) NCURSES_VOID strlcat((d),(s),(n)) +#define _nc_STRCAT(d,s,n) NCURSES_VOID strlcat((d),(s),NCURSES_CAST(size_t,n)) #else #define _nc_STRCAT(d,s,n) NCURSES_VOID strcat((d),(s)) #endif #if USE_STRING_HACKS && HAVE_STRLCPY -#define _nc_STRCPY(d,s,n) NCURSES_VOID strlcpy((d),(s),(n)) +#define _nc_STRCPY(d,s,n) NCURSES_VOID strlcpy((d),(s),NCURSES_CAST(size_t,n)) #else #define _nc_STRCPY(d,s,n) NCURSES_VOID strcpy((d),(s)) #endif #if USE_STRING_HACKS && HAVE_SNPRINTF #define _nc_SPRINTF NCURSES_VOID snprintf -#define _nc_SLIMIT(n) (n), +#define _nc_SLIMIT(n) NCURSES_CAST(size_t,n), #else #define _nc_SPRINTF NCURSES_VOID sprintf #define _nc_SLIMIT(n) /* nothing */