"Fossies" - the Fresh Open Source Software Archive

Member "passwdqc-2.0.3/passwdqc_memzero.c" (23 Jun 2023, 315 Bytes) of package /linux/privat/passwdqc-2.0.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "passwdqc_memzero.c" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.4.0_vs_2.0.0.

    1 /*
    2  * Copyright (c) 2016 by Solar Designer.  See LICENSE.
    3  */
    4 
    5 #ifdef _MSC_VER
    6 #include <windows.h>
    7 #else
    8 #include <string.h>
    9 #endif
   10 
   11 static void memzero(void *buf, size_t len)
   12 {
   13 #ifdef _MSC_VER
   14     SecureZeroMemory(buf, len);
   15 #else
   16     memset(buf, 0, len);
   17 #endif
   18 }
   19 
   20 void (*_passwdqc_memzero)(void *, size_t) = memzero;