+/* Licensed under LGPLv2+ - see LICENSE file for details */
#include "grab_file.h"
#include <ccan/talloc/talloc.h>
#include <ccan/noerr/noerr.h>
size = &s;
*size = 0;
- if (fstat(fd, &st) == 0)
+ if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode))
max = st.st_size;
else
max = 16384;