From 240578adf0e495c1cbe5d7558ed8ef72a5bf02a7 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Fri, 19 Feb 2010 17:27:29 -0500 Subject: [PATCH] snprintf: fix warning about non null argument --- snprintf/wcio.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snprintf/wcio.h b/snprintf/wcio.h index 1b41ec9..0c955e5 100644 --- a/snprintf/wcio.h +++ b/snprintf/wcio.h @@ -48,6 +48,9 @@ struct wchar_io_data { #define WCIO_GET(fp) \ (_EXT(fp) ? &(_EXT(fp)->_wcio) : (struct wchar_io_data *)0) +#define WCIO_GET_NONULL(fp) \ + (&(_EXT(fp)->_wcio)) + #define _SET_ORIENTATION(fp, mode) \ do {\ struct wchar_io_data *_wcio = WCIO_GET(fp); \ @@ -76,6 +79,6 @@ do {\ } while (0) #define WCIO_INIT(fp) \ - memset(WCIO_GET(fp), 0, sizeof(struct wchar_io_data)) + memset(WCIO_GET_NONULL(fp), 0, sizeof(struct wchar_io_data)) #endif /*_WCIO_H_*/ -- 2.34.1