Re: trouble with g_stat
- From: James Cameron <quozl laptop org>
- To: GaryW <gary studiohd us>
- Cc: gtk-list gnome org
- Subject: Re: trouble with g_stat
- Date: Mon, 4 Jun 2018 13:21:58 +1000
On Sun, Jun 03, 2018 at 10:27:48PM -0400, GaryW wrote:
My use of g_stat causes a segfault, but regular stat works ok. I’m using
mingw64 on Win10 under msys2.
[...]
GString *fspec;
GStatBuf *stBuf;
//fspec->str tested to hold the correct file spec…
if(g_stat(fspec->str,stBuf)<0){… [9476 Segmentation fault]
stBuf is an uninitialised pointer. g_stat will try to write to the
address; undefined behaviour results.
Try allocating some memory of the right size, and assign that address
to the pointer before calling g_stat?
--
James Cameron
http://quozl.netrek.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]