|
From: | Andrew Eggenberger |
Subject: | Re: Truncated filenames in struct directs returned from dir_readdir |
Date: | Mon, 19 Apr 2021 18:27:55 -0500 |
Andrew Eggenberger, le dim. 18 avril 2021 20:27:09 -0500, a ecrit:
> while(i++ < amt){
> d = *(struct direct*)dirents;
That cannot work: d_name is a flexible array member, so the struct copy
wouldn't copy everything. Make this
> struct direct *d;
> d = (struct direct*)dirents;
and that'll work.
Also, you need to initialize dirents to NULL and dataCnt to 0, because
RPCs try to reuse the buffers you pass them.
Samuel
[Prev in Thread] | Current Thread | [Next in Thread] |