@@ -4064,7 +4064,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da
4064
4064
4065
4065
/* create 1D attributes with dimension [2], 2 elements */
4066
4066
hsize_t dims [1 ] = {2 };
4067
- char buf1 [2 ][3 ] = {"ab" , "de" }; /* string */
4067
+ char buf1 [2 ][2 ] = {"ab" , "de" }; /* string, NO NUL fixed length */
4068
4068
char buf2 [2 ] = {1 , 2 }; /* bitfield, opaque */
4069
4069
s_t buf3 [2 ] = {{1 , 2 }, {3 , 4 }}; /* compound */
4070
4070
hobj_ref_t buf4 [2 ]; /* reference */
@@ -4076,8 +4076,8 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da
4076
4076
4077
4077
/* create 2D attributes with dimension [3][2], 6 elements */
4078
4078
hsize_t dims2 [2 ] = {3 , 2 };
4079
- char buf12 [6 ][3 ] = {"ab" , "cd" , "ef" , "gh" , "ij" , "kl" }; /* string */
4080
- char buf22 [3 ][2 ] = {{1 , 2 }, {3 , 4 }, {5 , 6 }}; /* bitfield, opaque */
4079
+ char buf12 [6 ][2 ] = {"ab" , "cd" , "ef" , "gh" , "ij" , "kl" }; /* string, NO NUL fixed length */
4080
+ char buf22 [3 ][2 ] = {{1 , 2 }, {3 , 4 }, {5 , 6 }}; /* bitfield, opaque */
4081
4081
s_t buf32 [6 ] = {{1 , 2 }, {3 , 4 }, {5 , 6 }, {7 , 8 }, {9 , 10 }, {11 , 12 }}; /* compound */
4082
4082
hobj_ref_t buf42 [3 ][2 ]; /* reference */
4083
4083
hvl_t buf52 [3 ][2 ]; /* vlen */
@@ -4086,16 +4086,17 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da
4086
4086
float buf82 [3 ][2 ] = {{1 , 2 }, {3 , 4 }, {5 , 6 }}; /* float */
4087
4087
4088
4088
/* create 3D attributes with dimension [4][3][2], 24 elements */
4089
- hsize_t dims3 [3 ] = {4 , 3 , 2 };
4090
- char buf13 [24 ][3 ] = {"ab" , "cd" , "ef" , "gh" , "ij" , "kl" , "mn" , "pq" , "rs" , "tu" , "vw" , "xz" ,
4091
- "AB" , "CD" , "EF" , "GH" , "IJ" , "KL" , "MN" , "PQ" , "RS" , "TU" , "VW" , "XZ" }; /* string */
4092
- char buf23 [4 ][3 ][2 ]; /* bitfield, opaque */
4093
- s_t buf33 [4 ][3 ][2 ]; /* compound */
4094
- hobj_ref_t buf43 [4 ][3 ][2 ]; /* reference */
4095
- hvl_t buf53 [4 ][3 ][2 ]; /* vlen */
4096
- int buf63 [24 ][3 ]; /* array */
4097
- int buf73 [4 ][3 ][2 ]; /* integer */
4098
- float buf83 [4 ][3 ][2 ]; /* float */
4089
+ hsize_t dims3 [3 ] = {4 , 3 , 2 };
4090
+ char buf13 [24 ][2 ] = {
4091
+ "ab" , "cd" , "ef" , "gh" , "ij" , "kl" , "mn" , "pq" , "rs" , "tu" , "vw" , "xz" , "AB" ,
4092
+ "CD" , "EF" , "GH" , "IJ" , "KL" , "MN" , "PQ" , "RS" , "TU" , "VW" , "XZ" }; /* string, NO NUL fixed length */
4093
+ char buf23 [4 ][3 ][2 ]; /* bitfield, opaque */
4094
+ s_t buf33 [4 ][3 ][2 ]; /* compound */
4095
+ hobj_ref_t buf43 [4 ][3 ][2 ]; /* reference */
4096
+ hvl_t buf53 [4 ][3 ][2 ]; /* vlen */
4097
+ int buf63 [24 ][3 ]; /* array */
4098
+ int buf73 [4 ][3 ][2 ]; /* integer */
4099
+ float buf83 [4 ][3 ][2 ]; /* float */
4099
4100
4100
4101
/*-------------------------------------------------------------------------
4101
4102
* 1D attributes
@@ -4489,7 +4490,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da
4489
4490
4490
4491
/* create 1D attributes with dimension [2], 2 elements */
4491
4492
hsize_t dims [1 ] = {2 };
4492
- char buf1 [2 ][3 ] = {"ab" , "de" }; /* string */
4493
+ char buf1 [2 ][2 ] = {"ab" , "de" }; /* string, NO NUL fixed length */
4493
4494
char buf2 [2 ] = {1 , 2 }; /* bitfield, opaque */
4494
4495
s_t buf3 [2 ] = {{1 , 2 }, {3 , 4 }}; /* compound */
4495
4496
hobj_ref_t buf4 [2 ]; /* reference */
@@ -4501,8 +4502,8 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da
4501
4502
4502
4503
/* create 2D attributes with dimension [3][2], 6 elements */
4503
4504
hsize_t dims2 [2 ] = {3 , 2 };
4504
- char buf12 [6 ][3 ] = {"ab" , "cd" , "ef" , "gh" , "ij" , "kl" }; /* string */
4505
- char buf22 [3 ][2 ] = {{1 , 2 }, {3 , 4 }, {5 , 6 }}; /* bitfield, opaque */
4505
+ char buf12 [6 ][2 ] = {"ab" , "cd" , "ef" , "gh" , "ij" , "kl" }; /* string, NO NUL fixed length */
4506
+ char buf22 [3 ][2 ] = {{1 , 2 }, {3 , 4 }, {5 , 6 }}; /* bitfield, opaque */
4506
4507
s_t buf32 [6 ] = {{1 , 2 }, {3 , 4 }, {5 , 6 }, {7 , 8 }, {9 , 10 }, {11 , 12 }}; /* compound */
4507
4508
hobj_ref_t buf42 [3 ][2 ]; /* reference */
4508
4509
hvl_t buf52 [3 ][2 ]; /* vlen */
@@ -4511,16 +4512,17 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da
4511
4512
float buf82 [3 ][2 ] = {{1 , 2 }, {3 , 4 }, {5 , 6 }}; /* float */
4512
4513
4513
4514
/* create 3D attributes with dimension [4][3][2], 24 elements */
4514
- hsize_t dims3 [3 ] = {4 , 3 , 2 };
4515
- char buf13 [24 ][3 ] = {"ab" , "cd" , "ef" , "gh" , "ij" , "kl" , "mn" , "pq" , "rs" , "tu" , "vw" , "xz" ,
4516
- "AB" , "CD" , "EF" , "GH" , "IJ" , "KL" , "MN" , "PQ" , "RS" , "TU" , "VW" , "XZ" }; /* string */
4517
- char buf23 [4 ][3 ][2 ]; /* bitfield, opaque */
4518
- s_t buf33 [4 ][3 ][2 ]; /* compound */
4519
- hobj_ref_t buf43 [4 ][3 ][2 ]; /* reference */
4520
- hvl_t buf53 [4 ][3 ][2 ]; /* vlen */
4521
- int buf63 [24 ][3 ]; /* array */
4522
- int buf73 [4 ][3 ][2 ]; /* integer */
4523
- float buf83 [4 ][3 ][2 ]; /* float */
4515
+ hsize_t dims3 [3 ] = {4 , 3 , 2 };
4516
+ char buf13 [24 ][2 ] = {
4517
+ "ab" , "cd" , "ef" , "gh" , "ij" , "kl" , "mn" , "pq" , "rs" , "tu" , "vw" , "xz" , "AB" ,
4518
+ "CD" , "EF" , "GH" , "IJ" , "KL" , "MN" , "PQ" , "RS" , "TU" , "VW" , "XZ" }; /* string, NO NUL fixed length */
4519
+ char buf23 [4 ][3 ][2 ]; /* bitfield, opaque */
4520
+ s_t buf33 [4 ][3 ][2 ]; /* compound */
4521
+ hobj_ref_t buf43 [4 ][3 ][2 ]; /* reference */
4522
+ hvl_t buf53 [4 ][3 ][2 ]; /* vlen */
4523
+ int buf63 [24 ][3 ]; /* array */
4524
+ int buf73 [4 ][3 ][2 ]; /* integer */
4525
+ float buf83 [4 ][3 ][2 ]; /* float */
4524
4526
4525
4527
/*-------------------------------------------------------------------------
4526
4528
* 1D
0 commit comments