ffi: improve support for functions returning arrays
[m6w6/ext-psi] / psi.d / stat.psi
index 3d0e62330efdbd30e0c93c04703e333e7dcde847..68f67814df9d0f954874e148d8bec5c013fd7c7f 100644 (file)
@@ -2,7 +2,7 @@
 // extern int stat(char *path, struct stat *buf);
 function psi\stat(string $path, array &$buf = NULL) : int {
        let path = strval($path);
-       let buf = calloc(1, psi\SIZEOF_STRUCT_STAT);
+       let buf = calloc(1, sizeof(struct stat));
        return stat(path, buf) as to_int(stat);
        set $buf = to_array(*buf,
                to_int(st_dev),