aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-10-31 15:35:24 +0000
committerDavid Shaw <[email protected]>2002-10-31 15:35:24 +0000
commitd284a4d20022e41971b4c47cbd53872857e0b43a (patch)
tree72cb85c3b507136536ec01e8ce3930c08c0a71a2
parent* configure.ac: Add a check for volatile. (diff)
downloadgnupg-d284a4d20022e41971b4c47cbd53872857e0b43a.tar.gz
gnupg-d284a4d20022e41971b4c47cbd53872857e0b43a.zip
* util.h: Add wipememory() macro.
-rw-r--r--include/ChangeLog4
-rw-r--r--include/util.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index eabc078d5..7ff6a80f7 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2002-10-31 David Shaw <[email protected]>
+
+ * util.h: Add wipememory() macro.
+
2002-10-29 Stefan Bellon <[email protected]>
* util.h: Added parameter argument to make_basename() needed for
diff --git a/include/util.h b/include/util.h
index de56cbeae..9b9e0141c 100644
--- a/include/util.h
+++ b/include/util.h
@@ -261,6 +261,8 @@ int vasprintf ( char **result, const char *format, va_list args);
#define DIM(v) (sizeof(v)/sizeof((v)[0]))
#define DIMof(type,member) DIM(((type *)0)->member)
+#define wipememory(_ptr,_len) do { volatile char *_vptr=(volatile char *)(_ptr); size_t _vlen=(_len); while(_vlen) { *_vptr=0; _vptr++; _vlen--; } } while(0)
+
/******* RISC OS stuff ***********/
#ifdef __riscos__
/* needed for strcasecmp() */