#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: cdf.c,v 1.81 2016/06/01 22:21:14 christos Exp $")
+FILE_RCSID("@(#)$File: cdf.c,v 1.82 2016/06/01 22:25:25 christos Exp $")
#endif
#include <assert.h>
break;
/* If the it is not there, just fake it; some docs don't have it */
- if (i == dir->dir_len)
+ if (i == dir->dir_len) {
+ DPRINTF(("Cannot find root storage dir\n"));
goto out;
+ }
d = &dir->dir_tab[i];
*root = d;
/* If the it is not there, just fake it; some docs don't have it */
- if (d->d_stream_first_sector < 0)
+ if (d->d_stream_first_sector < 0) {
+ DPRINTF(("No first secror in dir\n"));
goto out;
+ }
return cdf_read_long_sector_chain(info, h, sat,
d->d_stream_first_sector, d->d_size, scn);
out:
scn->sst_tab = NULL;
(void)cdf_zero_stream(scn);
- errno = EFTYPE;
- return -1;
+ return 0;
}
static int
}
void
-cdf_dump_stream(const cdf_header_t *h, const cdf_stream_t *sst)
+cdf_dump_stream(const cdf_stream_t *sst)
{
size_t ss = sst->sst_ss;
cdf_dump(sst->sst_tab, ss * sst->sst_len);
name, d->d_stream_first_sector, d->d_size);
break;
}
- cdf_dump_stream(h, &scn);
+ cdf_dump_stream(&scn);
free(scn.sst_tab);
break;
default:
== -1)
err(1, "Cannot read short stream");
#ifdef CDF_DEBUG
- cdf_dump_stream(&h, &sst);
+ cdf_dump_stream(&sst);
#endif
#ifdef CDF_DEBUG
void cdf_dump_header(const cdf_header_t *);
void cdf_dump_sat(const char *, const cdf_sat_t *, size_t);
void cdf_dump(const void *, size_t);
-void cdf_dump_stream(const cdf_header_t *, const cdf_stream_t *);
+void cdf_dump_stream(const cdf_stream_t *);
void cdf_dump_dir(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *,
const cdf_sat_t *, const cdf_stream_t *, const cdf_dir_t *);
void cdf_dump_property_info(const cdf_property_info_t *, size_t);
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.56 2016/03/03 22:20:03 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.57 2016/05/03 16:08:49 christos Exp $")
#endif
#include <assert.h>
dir, "Catalog", scn)) == -1)
return i;
#ifdef CDF_DEBUG
- cdf_dump_catalog(&h, scn);
+ cdf_dump_catalog(h, scn);
#endif
if ((i = cdf_file_catalog(ms, h, scn)) == -1)
return -1;