mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-25 17:00:45 +08:00
[svn-r3264] Purpose:
Bug fix Description: I dropped the boat on this one. I assigned prefix to NULL after it'd been allocated...My bad. Solution: Stopped doing that. Platforms tested: Linux
This commit is contained in:
parent
2ae44ebdba
commit
8e20f98805
@ -838,7 +838,7 @@ dump_attr(hid_t attr, const char *attr_name, void UNUSED *op_data)
|
||||
*
|
||||
*-----------------------------------------------------------------------*/
|
||||
static herr_t
|
||||
dump_selected_attr(hid_t loc_id, char *name)
|
||||
dump_selected_attr(hid_t loc_id, const char *name)
|
||||
{
|
||||
int j;
|
||||
char *obj_name, *attr_name;
|
||||
@ -1685,7 +1685,7 @@ main(int argc, const char *argv[])
|
||||
{
|
||||
hid_t fid, gid;
|
||||
const char *progname = "h5dump";
|
||||
char *fname = NULL;
|
||||
const char *fname = NULL;
|
||||
int i, display_bb = 0, display_all = 1, newwidth = 0;
|
||||
void *edata;
|
||||
hid_t (*func)(void*);
|
||||
@ -1834,8 +1834,7 @@ main(int argc, const char *argv[])
|
||||
/* init the find_objs_t */
|
||||
info.threshold = 0;
|
||||
info.prefix_len = prefix_len;
|
||||
info.prefix = malloc((size_t)info.prefix_len);
|
||||
info.prefix[0] = '\0';
|
||||
info.prefix = calloc((size_t)info.prefix_len, 1);
|
||||
info.group_table = group_table;
|
||||
info.type_table = type_table;
|
||||
info.dset_table = dset_table;
|
||||
@ -1843,7 +1842,6 @@ main(int argc, const char *argv[])
|
||||
|
||||
/* find all shared objects */
|
||||
H5Giterate(fid, "/", NULL, find_objs, (void *)&info);
|
||||
prefix = NULL;
|
||||
|
||||
/* does there exist unamed committed data type */
|
||||
for (i = 0; i < type_table->nobjs; i++)
|
||||
|
12
tools/h5ls.c
12
tools/h5ls.c
@ -15,18 +15,6 @@
|
||||
#include <H5private.h>
|
||||
#include <h5tools.h>
|
||||
|
||||
/*
|
||||
* File drivers
|
||||
*/
|
||||
#if defined VERSION13
|
||||
#include <H5FDsec2.h>
|
||||
#include <H5FDmulti.h>
|
||||
#include <H5FDfamily.h>
|
||||
#elif defined VERSION12
|
||||
#include <H5Fpublic.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* If defined then include the file name as part of the object name when
|
||||
* printing full object names. Otherwise leave the file name off.
|
||||
|
@ -14,13 +14,9 @@
|
||||
#include <hdf5.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if H5_VERS_MAJOR == 1
|
||||
# if H5_VERS_MINOR == 2
|
||||
# define VERSION12
|
||||
# elif H5_VERS_MINOR == 3
|
||||
# define VERSION13
|
||||
# endif /* H5_VERS_MINOR == 2 */
|
||||
#endif /* H5_VERS_MAJOR = 1 */
|
||||
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 2
|
||||
#define VERSION12
|
||||
#endif /* H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 2 */
|
||||
|
||||
#define ESCAPE_HTML 1
|
||||
|
||||
@ -387,7 +383,7 @@ enum {
|
||||
* the ``opt_arg'' variable. get_option returns the shortname equivalent of
|
||||
* the option. The long options are specified in the following way:
|
||||
*
|
||||
* struct long_options[] = {
|
||||
* struct long_options foo[] = {
|
||||
* { "filename", require_arg, 'f' },
|
||||
* { "append", no_arg, 'a' },
|
||||
* { "width", require_arg, 'w' },
|
||||
@ -410,8 +406,8 @@ enum {
|
||||
* end.
|
||||
*/
|
||||
typedef struct long_options {
|
||||
const char *name; /* name of the long option */
|
||||
int has_arg; /* whether we should look for an arg */
|
||||
const char *name; /* name of the long option */
|
||||
int has_arg; /* whether we should look for an arg */
|
||||
char shortval; /* the shortname equivalent of long arg
|
||||
* this gets returned from get_option */
|
||||
} long_options;
|
||||
@ -424,9 +420,9 @@ extern int get_option(int argc, const char **argv, const char *opt,
|
||||
|
||||
extern hid_t h5dump_fixtype(hid_t f_type);
|
||||
extern int h5dump_dset(FILE *stream, const h5dump_t *info, hid_t dset,
|
||||
hid_t p_typ, int indentlevel);
|
||||
hid_t p_typ, int indentlevel);
|
||||
extern int h5dump_mem(FILE *stream, const h5dump_t *info, hid_t obj_id,
|
||||
hid_t type, hid_t space, void *mem, int indentlevel);
|
||||
hid_t type, hid_t space, void *mem, int indentlevel);
|
||||
extern hid_t h5dump_fopen(const char *fname, char *drivername, size_t drivername_len);
|
||||
|
||||
|
||||
@ -476,10 +472,11 @@ extern void init_prefix(char **temp, int);
|
||||
|
||||
#define COL 3
|
||||
|
||||
extern int indent;
|
||||
extern int indent; /*how far in to indent the line */
|
||||
extern int nCols; /*max number of columns for outputting */
|
||||
extern FILE *rawdatastream; /*output stream for raw data */
|
||||
|
||||
extern void indentation(int);
|
||||
extern int nCols;
|
||||
extern FILE *rawdatastream; /* output stream for raw data */
|
||||
|
||||
/* taken from h5dump.h*/
|
||||
#define BOOT_BLOCK "BOOT_BLOCK"
|
||||
|
Loading…
x
Reference in New Issue
Block a user