Fix compilation on Linux, add error checking to Win32 SCFmemopen and properly indent.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 4e72ccf987
commit 51f2bc1d81

@ -5,14 +5,8 @@
* Based on FMem.c of Alexandre Flori (2008/10/17 AF)
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "util-fmemopen.h"
#include "suricata-common.h"
#include "util-fmemopen.h"
#ifdef OS_DARWIN
#define USE_FMEM_WRAPPER 1
@ -43,6 +37,9 @@ FILE *SCFmemopen(void *buf, size_t size, const char *mode) {
return NULL;
FILE *f = fopen(filename, "wb");
if (NULL == f)
return NULL;
fwrite(buf, size, 1, f);
fclose(f);

Loading…
Cancel
Save