basename_len = strlen(basename);
} else {
/* For a unnamed type, there must be a field name */
- if(basename_len != 0) {
+ if((basename_len != 0)
+ && (basename[basename_len-1] != '_')
+ && (field_name[0] != '\0')) {
strncat(basename, "_", PATH_MAX - basename_len);
basename_len = strlen(basename);
}
char basename[PATH_MAX];
unsigned int basename_len = 0;
- strcpy(basename, nest_name);
+ strncpy(basename, nest_name, PATH_MAX);
basename_len = strlen(basename);
/* For a named type, we use the type_name directly */
strncpy(basename, td->type_name, PATH_MAX);
basename_len = strlen(basename);
} else {
- /* For a unnamed type, there must be a field name */
- if(basename_len != 0) {
+ /* For a unnamed type, there must be a field name, except for
+ * the array. */
+ if((basename_len != 0)
+ && (basename[basename_len-1] != '_'
+ && (field_name[0] != '\0'))) {
strncat(basename, "_", PATH_MAX - basename_len);
basename_len = strlen(basename);
}
strncat(basename, field_name, PATH_MAX - basename_len);
- dprintf("%s\n", field_name);
}
switch(td->type) {
break;
case ARRAY:
+ dprintf("%s\n", basename);
assert(td->size >= 0);
if(td->nested_type->type_name == NULL) {
/* Not a named nested type : we must print its declaration first */
</event>
<event name=big_array>
- <field name="myarray"><array size=10000><pointer></array></field>
+ <field name="myarray"><array size=10000>
+ <array size = 2>
+ <struct>
+ <field name=a><pointer></field>
+ <field name=b><union>
+ <field name=c><pointer></field>
+ </union>
+ </field>
+ </struct>
+ </array></array></field>
</event>
<type name=tasklet_priority>